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.

eslint: Fix unicorn/prefer-simplified-conditions.

Anders Kaseorg8d4edfe03c09
diff --git a/web/src/filter.ts b/web/src/filter.ts
index 2a2404e30ca..261373198d6 100644
--- a/web/src/filter.ts
+++ b/web/src/filter.ts
@@ -1574,10 +1574,10 @@ export class Filter {
// Nice explanatory titles for common views.
const term_types = this.sorted_term_types();
if (
- (term_types.length === 3 && _.isEqual(term_types, ["channel", "topic", "near"])) ||
- (term_types.length === 3 && _.isEqual(term_types, ["channel", "topic", "with"])) ||
- (term_types.length === 2 && _.isEqual(term_types, ["channel", "topic"])) ||
- (term_types.length === 1 && _.isEqual(term_types, ["channel"]))
+ _.isEqual(term_types, ["channel", "topic", "near"]) ||
+ _.isEqual(term_types, ["channel", "topic", "with"]) ||
+ _.isEqual(term_types, ["channel", "topic"]) ||
+ _.isEqual(term_types, ["channel"])
) {
const sub = stream_data.get_sub_by_id_string(
this.terms_with_operator("channel")[0]!.operand,
@@ -1589,9 +1589,9 @@ export class Filter {
}
const ignore_missing = true;
if (
- (term_types.length === 2 && _.isEqual(term_types, ["dm", "near"])) ||
- (term_types.length === 2 && _.isEqual(term_types, ["dm", "with"])) ||
- (term_types.length === 1 && _.isEqual(term_types, ["dm"]))
+ _.isEqual(term_types, ["dm", "near"]) ||
+ _.isEqual(term_types, ["dm", "with"]) ||
+ _.isEqual(term_types, ["dm"])
) {
const user_ids = this.terms_with_operator("dm")[0]!.operand;
if (user_ids.length === 1) {