mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-14 08:05:10 +01:00
add global extension check
This commit is contained in:
parent
f248a5ff61
commit
e2f1f8274b
@ -31,6 +31,7 @@ import { SettingsSyncer } from "@/stores/subtitles/SettingsSyncer";
|
|||||||
import { ThemeProvider } from "@/stores/theme";
|
import { ThemeProvider } from "@/stores/theme";
|
||||||
import { TurnstileProvider } from "@/stores/turnstile";
|
import { TurnstileProvider } from "@/stores/turnstile";
|
||||||
|
|
||||||
|
import { extensionInfo } from "./backend/extension/messaging";
|
||||||
import { initializeChromecast } from "./setup/chromecast";
|
import { initializeChromecast } from "./setup/chromecast";
|
||||||
import { initializeOldStores } from "./stores/__old/migrations";
|
import { initializeOldStores } from "./stores/__old/migrations";
|
||||||
|
|
||||||
@ -140,6 +141,15 @@ function TheRouter(props: { children: ReactNode }) {
|
|||||||
return <HashRouter>{props.children}</HashRouter>;
|
return <HashRouter>{props.children}</HashRouter>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checks if the extension is installed
|
||||||
|
function ExtensionInfoLoader() {
|
||||||
|
useAsync(async () => {
|
||||||
|
await extensionInfo();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const container = document.getElementById("root");
|
const container = document.getElementById("root");
|
||||||
const root = createRoot(container!);
|
const root = createRoot(container!);
|
||||||
|
|
||||||
@ -149,6 +159,7 @@ root.render(
|
|||||||
<TurnstileProvider />
|
<TurnstileProvider />
|
||||||
<HelmetProvider>
|
<HelmetProvider>
|
||||||
<Suspense fallback={<LoadingScreen type="lazy" />}>
|
<Suspense fallback={<LoadingScreen type="lazy" />}>
|
||||||
|
<ExtensionInfoLoader />
|
||||||
<ThemeProvider applyGlobal>
|
<ThemeProvider applyGlobal>
|
||||||
<ProgressSyncer />
|
<ProgressSyncer />
|
||||||
<BookmarkSyncer />
|
<BookmarkSyncer />
|
||||||
|
Loading…
Reference in New Issue
Block a user