2026-06-11 02:19:47 +02:00
|
|
|
import React from "react";
|
|
|
|
|
import { createRoot } from "react-dom/client";
|
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
|
|
import App from "./App";
|
2026-06-11 19:26:34 +02:00
|
|
|
import ErrorBoundary from "./components/ErrorBoundary";
|
2026-06-14 01:29:44 +02:00
|
|
|
import PrivacyPolicy from "./components/legal/PrivacyPolicy";
|
|
|
|
|
import Terms from "./components/legal/Terms";
|
2026-06-11 02:19:47 +02:00
|
|
|
import "./index.css";
|
|
|
|
|
|
|
|
|
|
const queryClient = new QueryClient({
|
|
|
|
|
defaultOptions: { queries: { retry: false, staleTime: 30_000, refetchOnWindowFocus: false } },
|
|
|
|
|
});
|
|
|
|
|
|
2026-06-14 01:29:44 +02:00
|
|
|
// Public, login-free legal pages. They live outside the authenticated App tree (no /api/me)
|
|
|
|
|
// so Google's consent screen and reviewers can fetch them directly. Reached by full-page
|
|
|
|
|
// navigation (plain <a href>), so a simple pathname switch is enough — no router needed.
|
|
|
|
|
const path = window.location.pathname;
|
|
|
|
|
const root =
|
|
|
|
|
path === "/privacy" ? <PrivacyPolicy /> :
|
|
|
|
|
path === "/terms" ? <Terms /> : (
|
2026-06-11 02:19:47 +02:00
|
|
|
<QueryClientProvider client={queryClient}>
|
2026-06-11 19:26:34 +02:00
|
|
|
<ErrorBoundary>
|
|
|
|
|
<App />
|
|
|
|
|
</ErrorBoundary>
|
2026-06-11 02:19:47 +02:00
|
|
|
</QueryClientProvider>
|
2026-06-14 01:29:44 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
createRoot(document.getElementById("root")!).render(
|
|
|
|
|
<React.StrictMode>{root}</React.StrictMode>
|
2026-06-11 02:19:47 +02:00
|
|
|
);
|