Restore system theme when menu toggle matches system preference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Alexander Zinchuk 2026-01-20 12:00:45 +01:00
parent 0773b7313f
commit bde0dfc4f2

View File

@ -29,6 +29,7 @@ import { IS_MULTIACCOUNT_SUPPORTED } from '../../../util/browser/globalEnvironme
import { IS_TAURI } from '../../../util/browser/globalEnvironment';
import { getPromptInstall } from '../../../util/installPrompt';
import { switchPermanentWebVersion } from '../../../util/permanentWebVersion';
import { getSystemTheme } from '../../../util/systemTheme';
import { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager';
import useLang from '../../../hooks/useLang';
@ -106,9 +107,10 @@ const LeftSideMenuItems = ({
const handleDarkModeToggle = useLastCallback((e: React.SyntheticEvent<HTMLElement>) => {
e.stopPropagation();
const newTheme = theme === 'light' ? 'dark' : 'light';
const shouldUseSystemTheme = newTheme === getSystemTheme();
setSharedSettingOption({ theme: newTheme });
setSharedSettingOption({ shouldUseSystemTheme: false });
setSharedSettingOption({ shouldUseSystemTheme });
});
const handleAnimationLevelChange = useLastCallback((e: React.SyntheticEvent<HTMLElement>) => {