From e7b7ab7d0b7fde6b3d8709f20400a4dac82d2e69 Mon Sep 17 00:00:00 2001 From: byeoon <47872200+byeoon@users.noreply.github.com> Date: Thu, 6 Feb 2025 22:10:31 -0500 Subject: [PATCH] switch to copyWithToast instead of showing toast + copying --- src/plugins/copyStickerLinks/index.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/copyStickerLinks/index.tsx b/src/plugins/copyStickerLinks/index.tsx index b3ddd6810..b1a399ca0 100644 --- a/src/plugins/copyStickerLinks/index.tsx +++ b/src/plugins/copyStickerLinks/index.tsx @@ -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>) 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!"); } } />