mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-21 01:42:40 -05:00
Fix 404 page showing you as logged out
This commit is contained in:
20
app/root.tsx
20
app/root.tsx
@@ -20,6 +20,7 @@ import {
|
||||
useNavigate,
|
||||
useNavigation,
|
||||
useRevalidator,
|
||||
useRouteLoaderData,
|
||||
useSearchParams,
|
||||
} from "react-router";
|
||||
import { Config } from "~/config";
|
||||
@@ -440,9 +441,24 @@ export default function App() {
|
||||
}
|
||||
|
||||
export function ErrorBoundary() {
|
||||
const rootData = useRouteLoaderData<RootLoaderData>("root");
|
||||
|
||||
if (!rootData) {
|
||||
return (
|
||||
<ThemeProvider themeSource="static" specifiedTheme={Theme.DARK}>
|
||||
<Document>
|
||||
<Catcher />
|
||||
</Document>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ThemeProvider themeSource="static" specifiedTheme={Theme.DARK}>
|
||||
<Document>
|
||||
<ThemeProvider
|
||||
specifiedTheme={isTheme(rootData.theme) ? rootData.theme : null}
|
||||
themeSource="user-preference"
|
||||
>
|
||||
<Document data={rootData}>
|
||||
<Catcher />
|
||||
</Document>
|
||||
</ThemeProvider>
|
||||
|
||||
4
changelog/2026-10-03-error-page-logged-in.md
Normal file
4
changelog/2026-10-03-error-page-logged-in.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
type: bug
|
||||
---
|
||||
Error pages such as "Page not found" no longer show you as logged out
|
||||
Reference in New Issue
Block a user