From c03741df9391a28a1a6921902219dc4f90ea8c63 Mon Sep 17 00:00:00 2001 From: silentoplayz Date: Sun, 27 Jul 2025 04:02:05 -0400 Subject: [PATCH] fix(frontend): Ensure 'Her' theme is always a light theme This commit fixes a bug where the 'Her' theme would switch to dark mode after a logout/login cycle. The issue was caused by two problems: 1. The `dark` class was being incorrectly added to the `documentElement` when the 'Her' theme was selected in `src/app.html`. 2. The `applyTheme` function in `src/lib/components/chat/Settings/General.svelte` was not explicitly setting the 'Her' theme as a light theme. This commit resolves both of these issues, ensuring that the 'Her' theme is always a light theme. --- src/app.html | 1 - src/lib/components/chat/Settings/General.svelte | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app.html b/src/app.html index 1c2b7f061c..30a0ecc067 100644 --- a/src/app.html +++ b/src/app.html @@ -56,7 +56,6 @@ document.documentElement.classList.add('light'); metaThemeColorTag.setAttribute('content', '#ffffff'); } else if (localStorage.theme === 'her') { - document.documentElement.classList.add('dark'); document.documentElement.classList.add('her'); metaThemeColorTag.setAttribute('content', '#983724'); } else { diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 6b805c9a06..5929bf307e 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -117,7 +117,7 @@ }); const applyTheme = (_theme: string) => { - let themeToApply = _theme === 'oled-dark' ? 'dark' : _theme; + let themeToApply = _theme === 'oled-dark' ? 'dark' : _theme === 'her' ? 'light' : _theme; if (_theme === 'system') { themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';