From 4aedb129ea92a5ceef4649a84e7ef7a71cce3449 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 9 Nov 2021 10:05:08 -0800 Subject: [PATCH] settings: Add comments for default settings update_page. --- static/js/settings_realm_user_settings_defaults.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/settings_realm_user_settings_defaults.js b/static/js/settings_realm_user_settings_defaults.js index ada7415055..a1be40f693 100644 --- a/static/js/settings_realm_user_settings_defaults.js +++ b/static/js/settings_realm_user_settings_defaults.js @@ -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(); }