stream_settings: Update save discard buttons when live-updating.

This commit adds code to hide save discard buttons and
discard the changes if another user changed a setting
in the same subsection.
This commit is contained in:
Sahil Batra 2024-06-18 15:47:04 +05:30 committed by Tim Abbott
parent 5da1e57fc2
commit 08f35e08a4
1 changed files with 6 additions and 1 deletions

View File

@ -399,7 +399,12 @@ export function update_setting_element(sub, setting_name) {
} }
const $elem = $(`#id_${CSS.escape(setting_name)}`); const $elem = $(`#id_${CSS.escape(setting_name)}`);
settings_org.discard_stream_property_element_changes($elem, sub); const $subsection = $elem.closest(".settings-subsection-parent");
if ($subsection.find(".save-button-controls").hasClass("hide")) {
settings_org.discard_stream_property_element_changes($elem);
} else {
settings_org.discard_stream_settings_subsection_changes($subsection, sub);
}
} }
export function enable_or_disable_add_subscribers_elements( export function enable_or_disable_add_subscribers_elements(