mirror of https://github.com/zulip/zulip.git
narrow_state: Remove unused narrowed_to_search, narrowed_to_starred.
They’re unused as of commit de0db7ad1a
(#28636).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
b11bf32f8f
commit
8f07d830f2
|
@ -369,17 +369,6 @@ export function narrowed_to_topic(current_filter: Filter | undefined = filter())
|
|||
return current_filter.has_operator("stream") && current_filter.has_operator("topic");
|
||||
}
|
||||
|
||||
export function narrowed_to_search(current_filter: Filter | undefined = filter()): boolean {
|
||||
return current_filter !== undefined && current_filter.is_keyword_search();
|
||||
}
|
||||
|
||||
export function narrowed_to_starred(current_filter: Filter | undefined = filter()): boolean {
|
||||
if (current_filter === undefined) {
|
||||
return false;
|
||||
}
|
||||
return current_filter.has_operand("is", "starred");
|
||||
}
|
||||
|
||||
export function is_for_stream_id(stream_id: number, filter?: Filter): boolean {
|
||||
// This is not perfect, since we still track narrows by
|
||||
// name, not id, but at least the interface is good going
|
||||
|
|
|
@ -74,31 +74,25 @@ test("narrowed", () => {
|
|||
assert.ok(!narrow_state.narrowed_by_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_pm_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_topic_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_search());
|
||||
assert.ok(!narrow_state.narrowed_to_topic());
|
||||
assert.ok(!narrow_state.narrowed_by_stream_reply());
|
||||
assert.equal(narrow_state.stream_sub(), undefined);
|
||||
assert.ok(!narrow_state.narrowed_to_starred());
|
||||
|
||||
set_filter([["stream", "Foo"]]);
|
||||
assert.ok(!narrow_state.narrowed_to_pms());
|
||||
assert.ok(!narrow_state.narrowed_by_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_pm_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_topic_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_search());
|
||||
assert.ok(!narrow_state.narrowed_to_topic());
|
||||
assert.ok(narrow_state.narrowed_by_stream_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_starred());
|
||||
|
||||
set_filter([["dm", "steve@zulip.com"]]);
|
||||
assert.ok(narrow_state.narrowed_to_pms());
|
||||
assert.ok(narrow_state.narrowed_by_reply());
|
||||
assert.ok(narrow_state.narrowed_by_pm_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_topic_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_search());
|
||||
assert.ok(!narrow_state.narrowed_to_topic());
|
||||
assert.ok(!narrow_state.narrowed_by_stream_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_starred());
|
||||
|
||||
set_filter([
|
||||
["stream", "Foo"],
|
||||
|
@ -108,30 +102,24 @@ test("narrowed", () => {
|
|||
assert.ok(narrow_state.narrowed_by_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_pm_reply());
|
||||
assert.ok(narrow_state.narrowed_by_topic_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_search());
|
||||
assert.ok(narrow_state.narrowed_to_topic());
|
||||
assert.ok(!narrow_state.narrowed_by_stream_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_starred());
|
||||
|
||||
set_filter([["search", "grail"]]);
|
||||
assert.ok(!narrow_state.narrowed_to_pms());
|
||||
assert.ok(!narrow_state.narrowed_by_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_pm_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_topic_reply());
|
||||
assert.ok(narrow_state.narrowed_to_search());
|
||||
assert.ok(!narrow_state.narrowed_to_topic());
|
||||
assert.ok(!narrow_state.narrowed_by_stream_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_starred());
|
||||
|
||||
set_filter([["is", "starred"]]);
|
||||
assert.ok(!narrow_state.narrowed_to_pms());
|
||||
assert.ok(!narrow_state.narrowed_by_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_pm_reply());
|
||||
assert.ok(!narrow_state.narrowed_by_topic_reply());
|
||||
assert.ok(!narrow_state.narrowed_to_search());
|
||||
assert.ok(!narrow_state.narrowed_to_topic());
|
||||
assert.ok(!narrow_state.narrowed_by_stream_reply());
|
||||
assert.ok(narrow_state.narrowed_to_starred());
|
||||
});
|
||||
|
||||
test("terms", () => {
|
||||
|
|
Loading…
Reference in New Issue