mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-02 16:22:20 -07:00
DOCS+FE+BE: cleanup, SSE wait for app initialization #1440
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -23,10 +23,19 @@ class NetAlertXStateManager {
|
||||
*/
|
||||
init() {
|
||||
if (this.initialized) return;
|
||||
// waiting until cache ready
|
||||
const waitForInit = () => {
|
||||
if (!isAppInitialized()) {
|
||||
setTimeout(waitForInit, 300);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("[NetAlertX State] Initializing state manager...");
|
||||
this.trySSE();
|
||||
this.initialized = true;
|
||||
console.log("[NetAlertX State] App initialized, starting state manager");
|
||||
this.trySSE();
|
||||
this.initialized = true;
|
||||
};
|
||||
|
||||
waitForInit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user