From e3118d8fc942d9476e61e971b1c9a2b35674c183 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 13 Nov 2024 09:47:34 -0800 Subject: [PATCH] Revert "settings_account: Move async call into ui_init." This reverts commit 8eb0ca3a7cc605ea3834cbedb2771a7697b9fc7c (#32068). We fixed the TypeScript configuration in #32327. Signed-off-by: Anders Kaseorg --- web/src/settings_account.ts | 8 ++------ web/src/settings_sections.js | 4 ++-- web/src/ui_init.js | 6 +----- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/web/src/settings_account.ts b/web/src/settings_account.ts index 7cd065c0a8..8193810366 100644 --- a/web/src/settings_account.ts +++ b/web/src/settings_account.ts @@ -286,11 +286,7 @@ export function update_privacy_settings_box(property: PrivacySettingName): void settings_components.set_input_element_value($input_elem, user_settings[property]); } -export function set_up( - load_password_quality: () => Promise< - (password: string, $bar: JQuery | undefined, $password_field: JQuery) => boolean - >, -): void { +export function set_up(): void { // Add custom profile fields elements to user account settings. add_custom_profile_fields_to_settings(); $("#account-settings-status").hide(); @@ -500,7 +496,7 @@ export function set_up( // zxcvbn.js is pretty big, and is only needed on password // change, so load it asynchronously. void (async () => { - password_quality = await load_password_quality(); + password_quality = (await import("./password_quality.ts")).password_quality; $("#pw_strength .bar").removeClass("hide"); $("#new_password").on("input", () => { diff --git a/web/src/settings_sections.js b/web/src/settings_sections.js index 517946998a..99f13e3a99 100644 --- a/web/src/settings_sections.js +++ b/web/src/settings_sections.js @@ -46,9 +46,9 @@ export function get_group(section) { } } -export function initialize(load_password_quality) { +export function initialize() { // personal - load_func_dict.set("your-account", () => settings_account.set_up(load_password_quality)); + load_func_dict.set("your-account", settings_account.set_up); load_func_dict.set("preferences", () => { settings_preferences.set_up(settings_preferences.user_settings_panel); }); diff --git a/web/src/ui_init.js b/web/src/ui_init.js index 0026356a95..7aa343002a 100644 --- a/web/src/ui_init.js +++ b/web/src/ui_init.js @@ -630,11 +630,7 @@ export function initialize_everything(state_data) { settings_notifications.initialize(); settings_realm_user_settings_defaults.initialize(); settings_panel_menu.initialize(); - settings_sections.initialize( - // zxcvbn.js is pretty big, and is only needed on password - // change, so load it asynchronously. - async () => (await import("./password_quality.ts")).password_quality, - ); + settings_sections.initialize(); settings_toggle.initialize(); about_zulip.initialize();