import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query"; import React from "react"; import ReactDOM from "react-dom/client"; import { BrowserRouter } from "react-router-dom"; import { App } from "./App"; import { I18nProvider } from "./i18n"; import { isSessionGone, signedOut } from "./lib/auth"; import "./lib/install"; // catches the install event, which can come before the app renders import { ThemeProvider } from "./lib/theme"; import "./index.css"; import "./plugins/plugin-ui.css"; // .wm-* classes for plugin bundles (SPEC ยง11.3) // Any request answered "not signed in" means the session is gone (signed out // elsewhere, or the account was blocked): go to sign-in instead of leaving the // page up with failing requests behind it. const onError = (error: unknown) => { if (isSessionGone(error)) signedOut(queryClient); }; const queryClient = new QueryClient({ queryCache: new QueryCache({ onError }), mutationCache: new MutationCache({ onError }), defaultOptions: { queries: { retry: false, refetchOnWindowFocus: false } }, }); ReactDOM.createRoot(document.getElementById("root")!).render( , );