From 07b07fc3547f1897b667c7ab7f552d0a18349d39 Mon Sep 17 00:00:00 2001 From: Jorrin Date: Thu, 18 Apr 2024 20:31:53 +0200 Subject: [PATCH] throw promise to trigger suspense --- src/index.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 29d76566..b6e76888 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -31,7 +31,10 @@ import { SettingsSyncer } from "@/stores/subtitles/SettingsSyncer"; import { ThemeProvider } from "@/stores/theme"; import { TurnstileProvider } from "@/stores/turnstile"; -import { extensionInfo } from "./backend/extension/messaging"; +import { + extensionInfo, + isExtensionActiveCached, +} from "./backend/extension/messaging"; import { initializeChromecast } from "./setup/chromecast"; import { initializeOldStores } from "./stores/__old/migrations"; @@ -142,10 +145,10 @@ function TheRouter(props: { children: ReactNode }) { } // Checks if the extension is installed -function ExtensionInfoLoader() { - useAsync(async () => { - await extensionInfo(); - }, []); +function ExtensionStatus() { + if (!isExtensionActiveCached()) { + throw extensionInfo(); + } return null; } @@ -159,7 +162,7 @@ root.render( }> - +