stream-settings: Fix stream settings panel title not updating.

Earlier in stream settings, clicking an unsubscribed stream in "all
streams" tab and then clicking subscribed tab, the right panel would
reset but the panel title and url hash would remain same as that of
the unsubscribed stream.

This commit fixes the behaviour and resets the panel title and url
hash to default.

Fixes zulip#28465.
This commit is contained in:
Pratik Chanda 2024-03-02 03:17:53 +05:30 committed by Tim Abbott
parent bfe4017663
commit f96ad02454
1 changed files with 4 additions and 9 deletions

View File

@ -469,7 +469,10 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {
.get_content_element($("#streams_overlay_container .streams-list"))
.append(widgets.get(stream_id));
}
maybe_reset_right_panel();
if ($(".stream-row.active").hasClass("notdisplayed")) {
stream_edit.empty_right_panel();
}
update_empty_left_panel_message();
// return this for test convenience
@ -489,14 +492,6 @@ export function get_left_panel_params() {
return params;
}
export function maybe_reset_right_panel() {
if ($(".stream-row.active").hasClass("notdisplayed")) {
$(".right .settings").hide();
$(".nothing-selected").show();
$(".stream-row.active").removeClass("active");
}
}
// Make it explicit that our toggler is not created right away.
export let toggler;