Misc fixes and additions
Some checks failed
Automated Container Build / build-and-push (push) Failing after 8s
Some checks failed
Automated Container Build / build-and-push (push) Failing after 8s
This commit is contained in:
parent
724d70e58b
commit
02eefdac0e
9 changed files with 311 additions and 65 deletions
|
|
@ -25,6 +25,19 @@ export default function Home() {
|
|||
|
||||
if (api.isAuthenticated()) {
|
||||
setState('app');
|
||||
// Load and apply saved theme from API
|
||||
try {
|
||||
const data = await api.getSettings();
|
||||
const s = data.settings || data;
|
||||
const theme = s.theme || 'dark';
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
document.documentElement.style.setProperty('color-scheme', theme);
|
||||
if (theme === 'light') document.documentElement.classList.remove('dark');
|
||||
else document.documentElement.classList.add('dark');
|
||||
localStorage.setItem('theme', theme);
|
||||
} catch {
|
||||
// Theme sync is non-critical
|
||||
}
|
||||
} else {
|
||||
setState('login');
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue