[UI > Toasts] Fix for recent versions

This commit is contained in:
Beef 2023-06-03 15:08:04 +01:00
parent 1bb79172d0
commit f2b67ee112

View file

@ -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,
});