mirror of
https://github.com/Equicord/Equicord.git
synced 2025-04-01 13:11:57 -04:00
Fix Remix
This commit is contained in:
parent
f6e702cbae
commit
7c5f01bf11
1 changed files with 5 additions and 3 deletions
|
@ -7,11 +7,12 @@
|
||||||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { disableStyle, enableStyle } from "@api/Styles";
|
import { disableStyle, enableStyle } from "@api/Styles";
|
||||||
|
import { PaintbrushIcon } from "@components/Icons";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import { getCurrentChannel } from "@utils/discord";
|
import { getCurrentChannel } from "@utils/discord";
|
||||||
import { closeModal, openModal } from "@utils/modal";
|
import { closeModal, openModal } from "@utils/modal";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { extractAndLoadChunksLazy, findByPropsLazy, findStoreLazy } from "@webpack";
|
import { extractAndLoadChunksLazy, findLazy, findStoreLazy } from "@webpack";
|
||||||
import { FluxDispatcher, Menu, MessageActions, RestAPI, showToast, SnowflakeUtils, Toasts } from "@webpack/common";
|
import { FluxDispatcher, Menu, MessageActions, RestAPI, showToast, SnowflakeUtils, Toasts } from "@webpack/common";
|
||||||
|
|
||||||
import RemixModal from "./RemixModal";
|
import RemixModal from "./RemixModal";
|
||||||
|
@ -20,7 +21,7 @@ import css from "./styles.css?managed";
|
||||||
const requireCreateStickerModal = extractAndLoadChunksLazy(["stickerInspected]:"]);
|
const requireCreateStickerModal = extractAndLoadChunksLazy(["stickerInspected]:"]);
|
||||||
const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/);
|
const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/);
|
||||||
|
|
||||||
const CloudUtils = findByPropsLazy("CloudUpload");
|
const CloudUpload = findLazy(m => m.prototype?.trackUploadFinished);
|
||||||
const PendingReplyStore = findStoreLazy("PendingReplyStore");
|
const PendingReplyStore = findStoreLazy("PendingReplyStore");
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ const MessageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
|
||||||
group.splice(index + 1, 0, <Menu.MenuItem
|
group.splice(index + 1, 0, <Menu.MenuItem
|
||||||
id="vc-remix"
|
id="vc-remix"
|
||||||
label="Remix"
|
label="Remix"
|
||||||
|
icon={PaintbrushIcon}
|
||||||
action={() => {
|
action={() => {
|
||||||
const key = openModal(modalProps =>
|
const key = openModal(modalProps =>
|
||||||
<RemixModal modalProps={modalProps} close={() => closeModal(key)} url={url} />
|
<RemixModal modalProps={modalProps} close={() => closeModal(key)} url={url} />
|
||||||
|
@ -67,7 +69,7 @@ export function sendRemix(blob: Blob) {
|
||||||
const reply = PendingReplyStore.getPendingReply(currentChannelId);
|
const reply = PendingReplyStore.getPendingReply(currentChannelId);
|
||||||
if (reply) FluxDispatcher.dispatch({ type: "DELETE_PENDING_REPLY", currentChannelId });
|
if (reply) FluxDispatcher.dispatch({ type: "DELETE_PENDING_REPLY", currentChannelId });
|
||||||
|
|
||||||
const upload = new CloudUtils.CloudUpload({
|
const upload = new CloudUpload({
|
||||||
file: new File([blob], "remix.png", { type: "image/png" }),
|
file: new File([blob], "remix.png", { type: "image/png" }),
|
||||||
isClip: false,
|
isClip: false,
|
||||||
isThumbnail: false,
|
isThumbnail: false,
|
||||||
|
|
Loading…
Add table
Reference in a new issue