summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/src/toaster.tsx19
1 files changed, 6 insertions, 13 deletions
diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 4f67c589..54c0d7fb 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -1,13 +1,5 @@
import type { ToastData, ToastNotification } from '@decky/api';
-import {
- ErrorBoundary,
- Patch,
- callOriginal,
- findModuleExport,
- injectFCTrampoline,
- replacePatch,
- sleep,
-} from '@decky/ui';
+import { ErrorBoundary, Patch, callOriginal, findModuleExport, injectFCTrampoline, replacePatch } from '@decky/ui';
import Toast from './components/Toast';
import Logger from './logger';
@@ -29,8 +21,6 @@ declare global {
class Toaster extends Logger {
private toastPatch?: Patch;
- private markReady!: () => void;
- private ready = new Promise<void>((r) => (this.markReady = r));
constructor() {
super('Toaster');
@@ -53,7 +43,6 @@ class Toaster extends Logger {
});
this.log('Initialized');
- sleep(4000).then(this.markReady);
}
toast(toast: ToastData): ToastNotification {
@@ -120,7 +109,11 @@ class Toaster extends Logger {
}
}, toast.expiration);
}
- this.ready.then(() => window.NotificationStore.ProcessNotification(info, toastData, ToastType.New));
+ try {
+ window.NotificationStore.ProcessNotification(info, toastData, ToastType.New);
+ } catch (e) {
+ this.error('Error while sending toast:', e);
+ }
return toastResult;
}