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.

filter: Fix inverted comparison in public_terms().

Tim Abbottfdb8b1e63638
diff --git a/web/src/filter.ts b/web/src/filter.ts
index fe26a72952a..a50d4820c45 100644
--- a/web/src/filter.ts
+++ b/web/src/filter.ts
@@ -1040,7 +1040,7 @@ export class Filter {
}
const narrow_stream = stream_data.get_sub_by_name(page_params.narrow_stream);
assert(narrow_stream !== undefined);
- return Number.parseInt(term.operand, 10) === narrow_stream.stream_id;
+ return Number.parseInt(term.operand, 10) !== narrow_stream.stream_id;
},
);
return safe_to_return;
diff --git a/web/tests/filter.test.cjs b/web/tests/filter.test.cjs
index 5fd28a91ab1..d53644f9768 100644
--- a/web/tests/filter.test.cjs
+++ b/web/tests/filter.test.cjs
@@ -968,7 +968,7 @@ test("public_terms", ({override}) => {
assert_same_terms(filter.public_terms(), expected_terms);
assert.ok(filter.can_bucket_by("channel"));
- terms = [{operator: "channel", operand: some_channel_id.toString()}];
+ terms = [{operator: "channel", operand: default_channel_id.toString()}];
filter = new Filter(terms);
override(page_params, "narrow_stream", "default");
assert_same_terms(filter.public_terms(), []);