Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Improve error message for password change.

Tim Abbott1d575007a39d
diff --git a/static/js/settings_account.js b/static/js/settings_account.js
index 5bd20c78bbe..8e87383dafc 100644
--- a/static/js/settings_account.js
+++ b/static/js/settings_account.js
@@ -466,6 +466,7 @@ export function set_up() {
setup.set_password_change_in_progress(false);
},
error_msg_element: change_password_error,
+ failure_msg_html: null,
};
settings_ui.do_settings_change(
channel.patch,
diff --git a/static/js/settings_ui.js b/static/js/settings_ui.js
index 529606f1653..10952281ee1 100644
--- a/static/js/settings_ui.js
+++ b/static/js/settings_ui.js
@@ -27,6 +27,7 @@ export function do_settings_change(
status_element,
{
success_msg_html = strings.success_html,
+ failure_msg_html = strings.failure_html,
success_continuation,
error_continuation,
sticky = false,
@@ -54,9 +55,9 @@ export function do_settings_change(
error(xhr) {
if (error_msg_element) {
loading.destroy_indicator(spinner);
- ui_report.error(strings.failure_html, xhr, error_msg_element);
+ ui_report.error(failure_msg_html, xhr, error_msg_element);
} else {
- ui_report.error(strings.failure_html, xhr, spinner);
+ ui_report.error(failure_msg_html, xhr, spinner);
}
if (error_continuation !== undefined) {
error_continuation(xhr);