mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Fix how we find if streams are muted.
This commit changes stream_data.in_home_view() to take a stream_id parameter, which will make it more robust to stream name changes. This fixes a bug. Now when an admin renames a stream you are looking at, it will correctly show itself to be un-muted. (Even with this fix, though, the stream appears to be inactive.) Some callers still do lookups by name, and they will call name_in_home_view() for now, which we can hopefully deprecate over time.
This commit is contained in:
@@ -15,10 +15,22 @@ function make_tab_data() {
|
||||
var tabs = [];
|
||||
var filter = narrow_state.filter();
|
||||
|
||||
function filtered_to_non_home_view_stream() {
|
||||
if (!filter.has_operator('stream')) {
|
||||
return false;
|
||||
}
|
||||
var stream_name = filter.operands('stream')[0];
|
||||
var stream_id = stream_data.get_stream_id(stream_name);
|
||||
if (!stream_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !stream_data.in_home_view(stream_id);
|
||||
}
|
||||
|
||||
// Root breadcrumb item: Either Home or All Messages
|
||||
if (filter !== undefined &&
|
||||
((filter.has_operator("stream") &&
|
||||
!stream_data.in_home_view(filter.operands("stream")[0])) ||
|
||||
(filtered_to_non_home_view_stream() ||
|
||||
filter.has_operand("in", "all"))) {
|
||||
tabs.push(make_tab("All Messages", "#narrow/in/all", undefined, "root"));
|
||||
} else if (page_params.narrow !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user