mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-11-05 05:36:03 +00:00
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
|
|
import React from 'react';
|
|
|
|
import QueryClientEventHandler from 'components/QueryClientEventHandler';
|
|
import { ApiProvider } from 'hooks/useApi';
|
|
import { UserSettingsProvider } from 'hooks/useUserSettings';
|
|
import { WebConfigProvider } from 'hooks/useWebConfig';
|
|
import browser from 'scripts/browser';
|
|
import { persister, queryClient } from 'utils/query/queryClient';
|
|
|
|
import RootAppRouter from 'RootAppRouter';
|
|
|
|
const useReactQueryDevtools = window.Proxy // '@tanstack/query-devtools' requires 'Proxy', which cannot be polyfilled for legacy browsers
|
|
&& !browser.tv; // Don't use devtools on the TV as the navigation is weird
|
|
|
|
const RootApp = () => (
|
|
<PersistQueryClientProvider
|
|
client={queryClient}
|
|
persistOptions={{
|
|
buster: __JF_BUILD_VERSION__,
|
|
persister
|
|
}}
|
|
>
|
|
<ApiProvider>
|
|
<UserSettingsProvider>
|
|
<WebConfigProvider>
|
|
<QueryClientEventHandler />
|
|
<RootAppRouter />
|
|
</WebConfigProvider>
|
|
</UserSettingsProvider>
|
|
</ApiProvider>
|
|
{useReactQueryDevtools && (
|
|
<ReactQueryDevtools initialIsOpen={false} />
|
|
)}
|
|
</PersistQueryClientProvider>
|
|
);
|
|
|
|
export default RootApp;
|