mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
switch to copyWithToast instead of showing toast + copying
This commit is contained in:
parent
1195f99de3
commit
e7b7ab7d0b
1 changed files with 3 additions and 7 deletions
|
@ -18,9 +18,10 @@
|
||||||
|
|
||||||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
import { copyWithToast } from "@utils/misc";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findStoreLazy } from "@webpack";
|
import { findStoreLazy } from "@webpack";
|
||||||
import { Clipboard, Constants, FluxDispatcher, Menu, React, RestAPI, Toasts } from "@webpack/common";
|
import { Constants, FluxDispatcher, Menu, React, RestAPI } from "@webpack/common";
|
||||||
import { Promisable } from "type-fest";
|
import { Promisable } from "type-fest";
|
||||||
|
|
||||||
const StickersStore = findStoreLazy("StickersStore");
|
const StickersStore = findStoreLazy("StickersStore");
|
||||||
|
@ -74,12 +75,7 @@ function buildMenuItem(Sticker, fetchData: () => Promisable<Omit<Sticker, "t">>)
|
||||||
const res = await fetchData();
|
const res = await fetchData();
|
||||||
const data = { t: Sticker, ...res } as Sticker;
|
const data = { t: Sticker, ...res } as Sticker;
|
||||||
const url = getUrl(data);
|
const url = getUrl(data);
|
||||||
Toasts.show({
|
copyWithToast(url, "Link copied!");
|
||||||
message: "Link to sticker copied!",
|
|
||||||
type: Toasts.Type.SUCCESS,
|
|
||||||
id: Toasts.genId()
|
|
||||||
});
|
|
||||||
Clipboard.copy(url);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue