Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
filter: Return 'undefined' title for narrows with search operator.
Lauryn Menard857324a1645c
diff --git a/frontend_tests/node_tests/filter.js b/frontend_tests/node_tests/filter.jsindex 2715fd89f92..70f4b5eb15c 100644--- a/frontend_tests/node_tests/filter.js+++ b/frontend_tests/node_tests/filter.js@@ -1670,7 +1670,7 @@ test("navbar_helpers", () => {const stream_topic_search_operator_test_case = {operator: stream_topic_search_operator,- title: "Foo",+ title: undefined,};test_get_title(stream_topic_search_operator_test_case);diff --git a/static/js/filter.js b/static/js/filter.jsindex 85bd510cdef..3ca158afc74 100644--- a/static/js/filter.js+++ b/static/js/filter.js@@ -662,17 +662,14 @@ export class Filter {get_title() {// Nice explanatory titles for common views.const term_types = this.sorted_term_types();- if (- (term_types.length === 3 && _.isEqual(term_types, ["stream", "topic", "search"])) ||- (term_types.length === 2 && _.isEqual(term_types, ["stream", "topic"]))- ) {+ if (term_types.length === 2 && _.isEqual(term_types, ["stream", "topic"])) {if (!this._sub) {const search_text = this.operands("stream")[0];return $t({defaultMessage: "Unknown stream #{search_text}"}, {search_text});}return this._sub.name;}- if (term_types.length === 1 || (term_types.length === 2 && term_types[1] === "search")) {+ if (term_types.length === 1) {switch (term_types[0]) {case "in-home":return $t({defaultMessage: "All messages"});