mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-11 16:13:51 +03:00
remove useless toast delay
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user