fix: add page reload back to apply theme changes

This commit is contained in:
nmemmert committed 2026-01-16 08:01:45 -05:00
1 parent c18a3268fc
commit a6fcf0eb7b
2 files changed
+9 -18

No files matched your search

+5 -1
View File
@@ -62,7 +62,11 @@ export default function RootLayout({
html.classList.remove('dark');
} else if (theme === 'system') {
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (isDark) html.classList.add('dark');
if (isDark) {
html.classList.add('dark');
} else {
html.classList.remove('dark');
}
}
})();
`
+4 -17
View File
@@ -28,23 +28,10 @@ export default function SettingsPage({ userEmail }: SettingsPageProps) {
setCurrentTheme(newTheme);
localStorage.setItem('theme-mode', newTheme);
const html = document.documentElement;
if (newTheme === 'dark') {
html.classList.add('dark');
toast.success('🌙 Dark theme');
} else if (newTheme === 'light') {
html.classList.remove('dark');
toast.success('☀️ Light theme');
} else if (newTheme === 'system') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (prefersDark) {
html.classList.add('dark');
} else {
html.classList.remove('dark');
}
toast.success('🔄 System');
}
toast.success('🔄 Applying theme...');
setTimeout(() => {
window.location.reload();
}, 800);
};
return (