From 8ccd416e3bd01a961a0e31dc81433224f557f67c Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Thu, 27 Oct 2022 12:52:35 +0200 Subject: [PATCH] filter: Combine stream narrow cases in `filter.get_title`. --- static/js/filter.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/static/js/filter.js b/static/js/filter.js index 0a1a6f892b..bb867a80b8 100644 --- a/static/js/filter.js +++ b/static/js/filter.js @@ -664,7 +664,8 @@ export class Filter { const term_types = this.sorted_term_types(); if ( (term_types.length === 3 && _.isEqual(term_types, ["stream", "topic", "near"])) || - (term_types.length === 2 && _.isEqual(term_types, ["stream", "topic"])) + (term_types.length === 2 && _.isEqual(term_types, ["stream", "topic"])) || + (term_types.length === 1 && _.isEqual(term_types, ["stream"])) ) { if (!this._sub) { const search_text = this.operands("stream")[0]; @@ -697,12 +698,6 @@ export class Filter { return $t({defaultMessage: "All messages including muted streams"}); case "streams-public": return $t({defaultMessage: "Messages in all public streams"}); - case "stream": - if (!this._sub) { - const search_text = this.operands("stream")[0]; - return $t({defaultMessage: "Unknown stream #{search_text}"}, {search_text}); - } - return this._sub.name; case "is-starred": return $t({defaultMessage: "Starred messages"}); case "is-mentioned":