From 84a19203c57190dbffa7ab33ac33b3624ae8975a Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sat, 13 Aug 2022 11:57:52 -0400 Subject: fix injecting twice --- backend/main.py | 1 + frontend/src/index.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/main.py b/backend/main.py index 4129f5db..b6af4b8f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -98,6 +98,7 @@ class PluginManager: #await inject_to_tab("SP", "window.syncDeckyPlugins();") async def loader_reinjector(self): + await sleep(5) while True: await sleep(5) if not await tab_has_global_var("SP", "deckyHasLoaded"): diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 3df18093..0347388c 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -14,6 +14,7 @@ declare global { } } (async () => { + window.deckyHasLoaded = true; await sleep(1000); window.deckyAuthToken = await fetch('http://127.0.0.1:1337/auth/token').then((r) => r.text()); @@ -38,6 +39,4 @@ declare global { }; setTimeout(() => window.syncDeckyPlugins(), 5000); - - window.deckyHasLoaded = true; })(); -- cgit v1.2.3