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.

stream_settings: Make the right panel empty according to the URL hash.

Sahil Batraf3add0728093
diff --git a/web/src/stream_edit.js b/web/src/stream_edit.js
index 4605a8dbad3..97f3e8ceeac 100644
--- a/web/src/stream_edit.js
+++ b/web/src/stream_edit.js
@@ -93,11 +93,15 @@ export function open_edit_panel_for_row(stream_row) {
setup_stream_settings(stream_row);
}
-export function open_edit_panel_empty() {
- const tab_key = stream_settings_components.get_active_data().$tabs.first().attr("data-tab-key");
+export function empty_right_panel() {
$(".stream-row.active").removeClass("active");
$("#subscription_overlay .right").removeClass("show");
stream_settings_components.show_subs_pane.nothing_selected();
+}
+
+export function open_edit_panel_empty() {
+ const tab_key = stream_settings_components.get_active_data().$tabs.first().attr("data-tab-key");
+ empty_right_panel();
setup_subscriptions_tab_hash(tab_key);
}
diff --git a/web/src/stream_settings_ui.js b/web/src/stream_settings_ui.js
index 61433761e44..703bcfebc9c 100644
--- a/web/src/stream_settings_ui.js
+++ b/web/src/stream_settings_ui.js
@@ -706,17 +706,20 @@ export function change_state(section, right_side_tab) {
show_right_section();
} else {
toggler.goto("subscribed");
+ stream_edit.empty_right_panel();
}
return;
}
if (section === "all") {
toggler.goto("all-streams");
+ stream_edit.empty_right_panel();
return;
}
if (section === "subscribed") {
toggler.goto("subscribed");
+ stream_edit.empty_right_panel();
return;
}
@@ -734,6 +737,7 @@ export function change_state(section, right_side_tab) {
// In all these cases we redirect the user to 'subscribed' tab.
if (!sub || (page_params.is_guest && !stream_data.is_subscribed(stream_id))) {
toggler.goto("subscribed");
+ stream_edit.empty_right_panel();
} else {
show_right_section();
stream_edit_toggler.set_select_tab(right_side_tab);
@@ -744,6 +748,7 @@ export function change_state(section, right_side_tab) {
blueslip.warn("invalid section for streams: " + section);
toggler.goto("subscribed");
+ stream_edit.empty_right_panel();
}
export function launch(section, right_side_tab) {