From c17cd0ed958d8d29814e4845ca624892f1da1e94 Mon Sep 17 00:00:00 2001 From: lumap Date: Thu, 6 Feb 2025 23:48:02 +0100 Subject: [PATCH] fix toast types, oopsies --- src/plugins/addAttachments/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/addAttachments/index.tsx b/src/plugins/addAttachments/index.tsx index 7f3af45ca..4fd4d09c7 100644 --- a/src/plugins/addAttachments/index.tsx +++ b/src/plugins/addAttachments/index.tsx @@ -7,7 +7,7 @@ import { UploadIcon } from "@components/Icons"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -import { ChannelStore, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, showToast, UserStore } from "@webpack/common"; +import { ChannelStore, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, showToast, Toasts, UserStore } from "@webpack/common"; import { Common, findByPropsLazy } from "webpack"; const uniqueIdProp = findByPropsLazy("uniqueId"); @@ -45,11 +45,11 @@ export default definePlugin({ if (!input.files) return input.remove(); if ((10 - messageAttachments) < input.files.length) { - showToast(`You can only add ${10 - messageAttachments} more attachments to this message.`, 2); + showToast(`You can only add ${10 - messageAttachments} more attachments to this message.`, Toasts.Type.FAILURE); return input.remove(); } - showToast("Uploading, this can take a while..."); + showToast("Uploading, this can take a while...", Toasts.Type.CLOCK); const files = Array.from(input.files).map(file => ({ filename: file.name, @@ -88,6 +88,8 @@ export default definePlugin({ } }); + showToast("Attachments added successfully!", Toasts.Type.SUCCESS); + input.remove(); }); }