mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
Use narrow.stream() instead of stream_list.active_stream_name().
We no longer use active_stream_name(), which was mostly a duplicate of narrow.stream(). For nonsensical queries like "stream:foo stream:bar" the behavior may change slightly here. We know that we don't handle non-sensical queries particularly well, but at least if we always go through narrow.stream(), the behavior will be consistent. I did test this with some sensible compound narrows, like searching for a keyword within a stream.
This commit is contained in:
@@ -10,16 +10,6 @@ var last_mention_count = 0;
|
|||||||
var previous_sort_order;
|
var previous_sort_order;
|
||||||
var previous_unpinned_order;
|
var previous_unpinned_order;
|
||||||
|
|
||||||
function active_stream_name() {
|
|
||||||
if (narrow.active()) {
|
|
||||||
var op_streams = narrow.filter().operands('stream');
|
|
||||||
if (op_streams) {
|
|
||||||
return op_streams[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function filter_streams_by_search(streams) {
|
function filter_streams_by_search(streams) {
|
||||||
var search_box = $(".stream-list-filter");
|
var search_box = $(".stream-list-filter");
|
||||||
|
|
||||||
@@ -168,7 +158,7 @@ function zoom_in() {
|
|||||||
popovers.hide_all();
|
popovers.hide_all();
|
||||||
zoomed_to_topics = true;
|
zoomed_to_topics = true;
|
||||||
$("#streams_list").expectOne().removeClass("zoom-out").addClass("zoom-in");
|
$("#streams_list").expectOne().removeClass("zoom-out").addClass("zoom-in");
|
||||||
zoomed_stream = active_stream_name();
|
zoomed_stream = narrow.stream();
|
||||||
|
|
||||||
// Hide stream list titles and pinned stream splitter
|
// Hide stream list titles and pinned stream splitter
|
||||||
$(".stream-filters-label").each(function () {
|
$(".stream-filters-label").each(function () {
|
||||||
@@ -547,7 +537,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('narrow_activated.zulip', function (event) {
|
$(document).on('narrow_activated.zulip', function (event) {
|
||||||
reset_to_unnarrowed(active_stream_name() === zoomed_stream);
|
reset_to_unnarrowed(narrow.stream() === zoomed_stream);
|
||||||
|
|
||||||
// TODO: handle confused filters like "in:all stream:foo"
|
// TODO: handle confused filters like "in:all stream:foo"
|
||||||
var op_in = event.filter.operands('in');
|
var op_in = event.filter.operands('in');
|
||||||
|
|||||||
Reference in New Issue
Block a user