mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
settings: Make banner asking to confirm new email sticky.
We make the banner, mentioning the user to confirm new email after changing the email through settings, sticky and it disappears either on reload or after confirming the new email. Fixes #20686.
This commit is contained in:
@@ -223,8 +223,14 @@ run_test("updates", () => {
|
||||
updated = true;
|
||||
};
|
||||
|
||||
let confirm_banner_hidden = false;
|
||||
settings_account.hide_confirm_email_banner = () => {
|
||||
confirm_banner_hidden = true;
|
||||
};
|
||||
|
||||
user_events.update_person({user_id: me.user_id, delivery_email: "you@example.org"});
|
||||
assert.ok(updated);
|
||||
assert.ok(confirm_banner_hidden);
|
||||
|
||||
const test_bot = {
|
||||
email: "test-bot@example.com",
|
||||
|
||||
@@ -283,6 +283,13 @@ export function add_custom_profile_fields_to_settings() {
|
||||
initialize_custom_date_type_fields(element_id);
|
||||
}
|
||||
|
||||
export function hide_confirm_email_banner() {
|
||||
if (!overlays.settings_open()) {
|
||||
return;
|
||||
}
|
||||
$("#account-settings-status").hide();
|
||||
}
|
||||
|
||||
export function set_up() {
|
||||
// Add custom profile fields elements to user account settings.
|
||||
add_custom_profile_fields_to_settings();
|
||||
@@ -577,6 +584,7 @@ export function set_up() {
|
||||
{defaultMessage: "Check your email ({email}) to confirm the new address."},
|
||||
{email: data.email},
|
||||
),
|
||||
sticky: true,
|
||||
};
|
||||
settings_ui.do_settings_change(
|
||||
channel.patch,
|
||||
|
||||
@@ -50,6 +50,7 @@ export const update_person = function update(person) {
|
||||
if (people.is_my_user_id(person.user_id)) {
|
||||
settings_account.update_email(delivery_email);
|
||||
page_params.delivery_email = delivery_email;
|
||||
settings_account.hide_confirm_email_banner();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user