mirror of https://github.com/zulip/zulip.git
settings: Fix live-update bug for privacy settings.
The following three privacy settings weren't being live updated across multiple browser tabs/windows: * send_stream_typing_notifications * send_private_typing_notifications * send_read_receipts This commit fixes the bug.
This commit is contained in:
parent
340140954b
commit
75f6ae6d20
|
@ -706,6 +706,18 @@ export function dispatch_normal_event(event) {
|
|||
break;
|
||||
}
|
||||
|
||||
const privacy_settings = [
|
||||
"send_stream_typing_notifications",
|
||||
"send_private_typing_notifications",
|
||||
"send_read_receipts",
|
||||
];
|
||||
|
||||
if (privacy_settings.includes(event.property)) {
|
||||
user_settings[event.property] = event.value;
|
||||
settings_account.update_privacy_settings_box(event.property);
|
||||
break;
|
||||
}
|
||||
|
||||
const user_preferences = [
|
||||
"color_scheme",
|
||||
"web_font_size_px",
|
||||
|
@ -729,9 +741,6 @@ export function dispatch_normal_event(event) {
|
|||
"web_animate_image_previews",
|
||||
"web_stream_unreads_count_display_policy",
|
||||
"starred_message_counts",
|
||||
"send_stream_typing_notifications",
|
||||
"send_private_typing_notifications",
|
||||
"send_read_receipts",
|
||||
"web_navigate_to_sent_message",
|
||||
"enter_sends",
|
||||
];
|
||||
|
|
|
@ -20,6 +20,7 @@ import * as overlays from "./overlays";
|
|||
import {page_params} from "./page_params";
|
||||
import * as people from "./people";
|
||||
import * as settings_bots from "./settings_bots";
|
||||
import * as settings_components from "./settings_components";
|
||||
import * as settings_data from "./settings_data";
|
||||
import * as settings_org from "./settings_org";
|
||||
import * as settings_ui from "./settings_ui";
|
||||
|
@ -250,6 +251,16 @@ export function hide_confirm_email_banner() {
|
|||
$("#account-settings-status").hide();
|
||||
}
|
||||
|
||||
export function update_privacy_settings_box(property) {
|
||||
if (!overlays.settings_open()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $container = $("#account-settings");
|
||||
const $input_elem = $container.find(`[name=${CSS.escape(property)}]`);
|
||||
settings_components.set_input_element_value($input_elem, user_settings[property]);
|
||||
}
|
||||
|
||||
export function set_up() {
|
||||
// Add custom profile fields elements to user account settings.
|
||||
add_custom_profile_fields_to_settings();
|
||||
|
|
Loading…
Reference in New Issue