settings: Fix live update code for twenty_four_hour_time setting.

We need to handle live-update of twenty_four_hour_time setting
separately in update_page because the database value of this
setting is boolean but we use dropdown in the frontend for this
setting with option values as "true" and "false" strings.
This commit is contained in:
Sahil Batra
2021-11-09 18:47:09 +05:30
committed by Tim Abbott
parent 4a1153b06c
commit f49980098d

View File

@@ -26,12 +26,16 @@ export function update_page(property) {
return;
}
const container = $(realm_default_settings_panel.container);
const value = realm_user_settings_defaults[property];
let value = realm_user_settings_defaults[property];
if (property === "emojiset") {
container.find(`input[value=${CSS.escape(value)}]`).prop("checked", true);
return;
}
if (property === "twenty_four_hour_time") {
value = value.toString();
}
const input_elem = container.find(`[name=${CSS.escape(property)}]`);
settings_org.set_input_element_value(input_elem, value);
}