fix toasts breaking sometimes

This commit is contained in:
AAGaming
2022-08-14 21:59:55 -04:00
parent c9430f5be4
commit 0a735886c9

View File

@@ -35,7 +35,7 @@ class Toaster extends Logger {
while (true) {
instance = findInReactTree(
(document.getElementById('root') as any)._reactRootContainer._internalRoot.current,
(x) => x?.memoizedProps?.className?.startsWith('toastmanager_ToastPlaceholder'),
(x) => x?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPlaceholder'),
);
if (instance) break;
this.debug('finding instance');