Skip to content

Commit eea6417

Browse files
committed
fix: privacy routing
1 parent 152c407 commit eea6417

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { DesktopLayout } from "./components/DesktopLayout";
88
import Index from "./pages/Index";
99
import { UtilPage } from "./pages/UtilPage";
1010
import NotFound from "./pages/NotFound";
11+
import PrivacyRedirect from "./pages/PrivacyRedirect";
1112
import { isExtension, isTauri } from "@/lib/platform";
1213

1314
const queryClient = new QueryClient();
@@ -18,6 +19,7 @@ const queryClient = new QueryClient();
1819
*/
1920
const Router = isTauri() || isExtension() ? HashRouter : BrowserRouter;
2021
const AppLayout = isTauri() ? DesktopLayout : Layout;
22+
const isWeb = !isTauri() && !isExtension();
2123

2224
const App = () => (
2325
<QueryClientProvider client={queryClient}>
@@ -33,6 +35,8 @@ const App = () => (
3335
<Routes>
3436
<Route element={<AppLayout />}>
3537
<Route path="/" element={<Index />} />
38+
{isWeb && <Route path="/privacy" element={<PrivacyRedirect />} />}
39+
{isWeb && <Route path="/privacy/" element={<PrivacyRedirect />} />}
3640
<Route path="/:utilId" element={<UtilPage />} />
3741
</Route>
3842
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}

src/pages/PrivacyRedirect.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useEffect } from "react";
2+
3+
const PrivacyRedirect = () => {
4+
useEffect(() => {
5+
window.location.replace("/privacy/index.html");
6+
}, []);
7+
8+
return (
9+
<div className="min-h-screen flex items-center justify-center">
10+
<p className="text-sm text-muted-foreground">Redirecting to privacy policy…</p>
11+
</div>
12+
);
13+
};
14+
15+
export default PrivacyRedirect;

0 commit comments

Comments
 (0)