mirror of
https://github.com/zulip/zulip.git
synced 2026-06-30 21:11:04 +08:00
dark_theme: Add automatic color scheme support for spectators.
Similar to the light/dark theme support for the spectators, this adds the automatic color scheme support by storing the user's preference in the local storage.
This commit is contained in:
parent
e41d1fb48f
commit
2f6cc4a6b0
@ -27,4 +27,10 @@ export function disable(): void {
|
||||
|
||||
export function default_preference_checker(): void {
|
||||
$(":root").removeClass("dark-theme").addClass("color-scheme-automatic");
|
||||
|
||||
if (page_params.is_spectator) {
|
||||
const ls = localstorage();
|
||||
ls.set("spectator-theme-preference", "automatic");
|
||||
user_settings.color_scheme = settings_config.color_scheme_values.automatic.code;
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,6 +429,8 @@ export function initialize_everything(state_data) {
|
||||
dark_theme.enable();
|
||||
} else if (preferred_theme === "light") {
|
||||
dark_theme.disable();
|
||||
} else {
|
||||
dark_theme.default_preference_checker();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user