[UI > Toasts] Fix for recent versions
This commit is contained in:
parent
1bb79172d0
commit
f2b67ee112
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,13 @@
|
||||||
|
import { findByProps } from "@metro/filters";
|
||||||
import { toasts } from "@metro/common";
|
import { toasts } from "@metro/common";
|
||||||
|
|
||||||
|
const { uuid4 } = findByProps("uuid4");
|
||||||
|
|
||||||
export const showToast = (content: string, asset?: number) => toasts.open({
|
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,
|
content: content,
|
||||||
source: asset,
|
source: asset,
|
||||||
|
icon: asset,
|
||||||
});
|
});
|
Loading…
Reference in a new issue