mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 07:25:10 +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 { Devs } from "@utils/constants";
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
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";
|
||||
|
||||
const StickersStore = findStoreLazy("StickersStore");
|
||||
|
@ -74,12 +75,7 @@ function buildMenuItem(Sticker, fetchData: () => Promisable<Omit<Sticker, "t">>)
|
|||
const res = await fetchData();
|
||||
const data = { t: Sticker, ...res } as Sticker;
|
||||
const url = getUrl(data);
|
||||
Toasts.show({
|
||||
message: "Link to sticker copied!",
|
||||
type: Toasts.Type.SUCCESS,
|
||||
id: Toasts.genId()
|
||||
});
|
||||
Clipboard.copy(url);
|
||||
copyWithToast(url, "Link copied!");
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
|
Loading…
Add table
Reference in a new issue