From f2b67ee112a2d6299d59a1c1665d3ba433e05b53 Mon Sep 17 00:00:00 2001 From: Beef Date: Sat, 3 Jun 2023 15:08:04 +0100 Subject: [PATCH] [UI > Toasts] Fix for recent versions --- src/ui/toasts.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/toasts.ts b/src/ui/toasts.ts index c39a0a0..7af3d8e 100644 --- a/src/ui/toasts.ts +++ b/src/ui/toasts.ts @@ -1,6 +1,13 @@ +import { findByProps } from "@metro/filters"; import { toasts } from "@metro/common"; +const { uuid4 } = findByProps("uuid4"); + export const showToast = (content: string, asset?: number) => toasts.open({ + //? In build 182205/44707, Discord changed their toasts, source is no longer used, rather icon, and a key is needed. + // TODO: We could probably have the developer specify a key themselves, but this works to fix toasts + key: `vd-toast-${uuid4()}`, content: content, source: asset, + icon: asset, }); \ No newline at end of file