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.

user_profile: Move the widget clearing logic to open hook of modals.

roanster007bd6886929a2e
diff --git a/web/src/user_profile.js b/web/src/user_profile.js
index 85e58947c51..e7a0a0e4a7f 100644
--- a/web/src/user_profile.js
+++ b/web/src/user_profile.js
@@ -307,10 +307,13 @@ export function get_custom_profile_field_data(user, field, field_types) {
}
export function hide_user_profile() {
- user_streams_list_widget = undefined;
modals.close_if_open("user-profile-modal");
}
+function on_user_profile_hide() {
+ user_streams_list_widget = undefined;
+}
+
function show_manage_user_tab(target) {
toggler.goto(target);
}
@@ -386,7 +389,7 @@ export function show_user_profile(user, default_tab_key = "profile-tab") {
}
$("#user-profile-modal-holder").html(render_user_profile_modal(args));
- modals.open("user-profile-modal", {autoremove: true});
+ modals.open("user-profile-modal", {autoremove: true, on_hide: on_user_profile_hide});
$(".tabcontent").hide();
let default_tab = 0;