feat: synchronise settingstate and theme properly

This commit is contained in:
Alphons Joseph
2025-03-18 18:45:09 +08:00
parent 9fc24767ec
commit 8e34db4a67
@@ -23,10 +23,9 @@
if (theme.id === themes?.selectedTheme) { if (theme.id === themes?.selectedTheme) {
await disableTheme(); await disableTheme();
themes.selectedTheme = ''; themes.selectedTheme = '';
settingsState.selectedColor = settingsState.originalSelectedColor;
} else { } else {
await setTheme(theme.id); await setTheme(theme.id);
settingsState.selectedColor = theme.defaultColour; settingsState.selectedColor = theme.defaultColour; // settingsState and the theme need to be synchronised.
if (!themes) return; if (!themes) return;
themes.selectedTheme = theme.id; themes.selectedTheme = theme.id;
} }