mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 11:46:28 +00:00
fix: apply theme preference on login page
- Login component now applies saved theme preference on mount - Theme preference correctly persists across logout/login in all modes - Fixes issue where login page would revert to default theme after logout
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Component, createSignal, Show, onMount, lazy, Suspense } from 'solid-js';
|
||||
import { setBasicAuth } from '@/utils/apiClient';
|
||||
import { STORAGE_KEYS } from '@/constants';
|
||||
|
||||
// Force include FirstRunSetup with lazy loading
|
||||
const FirstRunSetup = lazy(() => import('./FirstRunSetup').then(m => ({ default: m.FirstRunSetup })));
|
||||
@@ -17,6 +18,14 @@ export const Login: Component<LoginProps> = (props) => {
|
||||
const [loadingAuth, setLoadingAuth] = createSignal(true);
|
||||
|
||||
onMount(async () => {
|
||||
// Apply saved theme preference
|
||||
const savedTheme = localStorage.getItem(STORAGE_KEYS.DARK_MODE);
|
||||
if (savedTheme === 'true') {
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
|
||||
console.log('[Login] Starting auth check...');
|
||||
try {
|
||||
const response = await fetch('/api/security/status');
|
||||
|
||||
Reference in New Issue
Block a user