Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
filter: Directly use `term.operand` to help with type checking.
Aman Agrawalace62a3054ab
diff --git a/web/src/filter.ts b/web/src/filter.tsindex fe32675f44e..a2d285704f8 100644--- a/web/src/filter.ts+++ b/web/src/filter.ts@@ -989,13 +989,13 @@ export class Filter {);}- const sorted_simplified_terms = filter_terms.map((term) => {- let operand = term.operand;+ const sorted_simplified_terms = filter_terms.map((filter_term) => {+ const term = {...filter_term};if (term.operator === "channel" || term.operator === "topic") {- operand = operand.toLowerCase();+ term.operand = term.operand.toLowerCase();}- return `${term.negated ? "0" : "1"}-${term.operator}-${operand}`;+ return `${term.negated ? "0" : "1"}-${term.operator}-${term.operand}`;});sorted_simplified_terms.sort(util.strcmp);