settings: Add comments for default settings update_page.

This commit is contained in:
Tim Abbott 2021-11-09 10:05:08 -08:00
parent f49980098d
commit 4aedb129ea
1 changed files with 6 additions and 0 deletions

View File

@ -28,10 +28,16 @@ export function update_page(property) {
const container = $(realm_default_settings_panel.container);
let value = realm_user_settings_defaults[property];
// settings_org.set_input_element_value doesn't support radio
// button widgets like this one.
if (property === "emojiset") {
container.find(`input[value=${CSS.escape(value)}]`).prop("checked", true);
return;
}
// The twenty_four_hour_time setting is represented as a boolean
// in the API, but a dropdown with "true"/"false" as strings in
// the UI, so we need to convert its format here.
if (property === "twenty_four_hour_time") {
value = value.toString();
}