filter: Combine stream narrow cases in filter.get_title.

This commit is contained in:
Lauryn Menard
2022-10-27 12:52:35 +02:00
committed by Tim Abbott
parent 0901ccdb47
commit 8ccd416e3b

View File

@@ -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":