mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
throw promise to trigger suspense
This commit is contained in:
parent
e2f1f8274b
commit
07b07fc354
1 changed files with 9 additions and 6 deletions
|
@ -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(
|
|||
<TurnstileProvider />
|
||||
<HelmetProvider>
|
||||
<Suspense fallback={<LoadingScreen type="lazy" />}>
|
||||
<ExtensionInfoLoader />
|
||||
<ExtensionStatus />
|
||||
<ThemeProvider applyGlobal>
|
||||
<ProgressSyncer />
|
||||
<BookmarkSyncer />
|
||||
|
|
Loading…
Reference in a new issue