diff --git a/src/client/App.tsx b/src/client/App.tsx index 5e8f684..69f9214 100644 --- a/src/client/App.tsx +++ b/src/client/App.tsx @@ -31,14 +31,29 @@ declare module '@tanstack/react-router' { } } +const AppRouter: React.FC = React.memo(() => { + const { info: userInfo } = useUserStore(); + + useInjectWebsiteScript(); + + return ( + + {/* Compatible with old routes */} + + + + + + + ); +}); +AppRouter.displayName = 'AppRouter'; + export const App: React.FC = React.memo(() => { const rootRef = useRef(null); const colorScheme = useColorSchema(); const algorithm = colorScheme === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm; - const { info: userInfo } = useUserStore(); - - useInjectWebsiteScript(); return (
@@ -49,14 +64,7 @@ export const App: React.FC = React.memo(() => { getPopupContainer={() => rootRef.current!} > - {/* Compatible with old routes */} - - - - - - - + diff --git a/src/client/store/settings.ts b/src/client/store/settings.ts index 274de17..7594799 100644 --- a/src/client/store/settings.ts +++ b/src/client/store/settings.ts @@ -10,7 +10,7 @@ export const useSettingsStore = create()( persist( () => ({ - colorScheme: 'light' as const, + colorScheme: 'dark' as const, }) as SettingsState, { name: 'settings',