mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
settings: Prevent save discard widget override.
This commit prevents the save button in the save discard widget from
showing the "Saved" label when the user has made some other changes
in the settings while the saving process was in action — which resulted
in the "Save changes" label in the save button, and thus shouldn't be
replaced with "Saved".
This commit also fixes the failing puppeteer tests in
`web/e2e-tests/admin.test.ts` which was introduced in #34081.
(cherry picked from commit 7b45ff50ba)
This commit is contained in:
@@ -560,6 +560,13 @@ export function change_save_button_state($element: JQuery, state: string): void
|
||||
return;
|
||||
}
|
||||
|
||||
if (state === "succeeded" && $save_button.attr("data-status") === "unsaved") {
|
||||
// We don't show the "saved" state if the save button is in the "unsaved"
|
||||
// state, as that would indicate that user has made some other changes
|
||||
// during the saving process.
|
||||
return;
|
||||
}
|
||||
|
||||
if (state !== "saving") {
|
||||
buttons.hide_button_loading_indicator($save_button);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user