wait for toaster ready, hopefully fix file browser patch

This commit is contained in:
AAGaming
2022-09-16 18:49:35 -04:00
parent 304fc0f94c
commit 463258febb
2 changed files with 20 additions and 5 deletions
+6 -1
View File
@@ -15,6 +15,7 @@ class Toaster extends Logger {
private instanceRetPatch?: Patch;
private node: any;
private settingsModule: any;
private ready: boolean = false;
constructor() {
super('Toaster');
@@ -72,9 +73,13 @@ class Toaster extends Logger {
};
this.node.stateNode.forceUpdate();
this.log('Initialized');
this.ready = true;
}
toast(toast: ToastData) {
async toast(toast: ToastData) {
while (!this.ready) {
await sleep(100);
}
const settings = this.settingsModule.settings;
let toastData = {
nNotificationID: window.NotificationStore.m_nNextTestNotificationID++,