mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
theme: Change recipient bar color and theme in the same paint.
`update_recipient_bar_background_color` changes in a paint after change in theme without using `requestAnimationFrame` to make sure they happen in the same paint.. Replaced `setTimeout` with `requestAnimationFrame` in `server_events_dispatch` since `requestAnimationFrame` already ensures that they happen in the next paint, assuming that was the intention of `setTimeout` being preset there.
This commit is contained in:
@@ -746,7 +746,7 @@ export function dispatch_normal_event(event) {
|
||||
unread_ui.update_unread_banner();
|
||||
}
|
||||
if (event.property === "color_scheme") {
|
||||
setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
if (event.value === settings_config.color_scheme_values.night.code) {
|
||||
dark_theme.enable();
|
||||
realm_logo.render();
|
||||
@@ -758,7 +758,7 @@ export function dispatch_normal_event(event) {
|
||||
realm_logo.render();
|
||||
}
|
||||
message_lists.update_recipient_bar_background_color();
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
if (event.property === "starred_message_counts") {
|
||||
starred_messages_ui.rerender_ui();
|
||||
|
||||
Reference in New Issue
Block a user