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.

search_suggestion: Pass only required parameter.

Aman Agrawal33469eb2d075
diff --git a/web/src/search_pill.ts b/web/src/search_pill.ts
index 8dde7bbe928..7e510e680cf 100644
--- a/web/src/search_pill.ts
+++ b/web/src/search_pill.ts
@@ -167,7 +167,7 @@ export function generate_pills_html(suggestion: Suggestion, text_query: string):
};
}
if (search_pill.operator === "search") {
- let description_html = search_term_description_html(search_pill);
+ let description_html = search_term_description_html(search_pill.operand);
// We capitalize the beginning of the suggestion line if it's text (not
// pills), which is only relevant for suggestions with search operators.
if (index === 0) {
diff --git a/web/src/search_suggestion.ts b/web/src/search_suggestion.ts
index b88b06c176b..9625f0e6501 100644
--- a/web/src/search_suggestion.ts
+++ b/web/src/search_suggestion.ts
@@ -1071,8 +1071,8 @@ class Attacher {
}
}
-export function search_term_description_html(item: NarrowTerm): string {
- return `search for ${Handlebars.Utils.escapeExpression(item.operand)}`;
+export function search_term_description_html(operand: string): string {
+ return `search for ${Handlebars.Utils.escapeExpression(operand)}`;
}
export function get_search_result(
@@ -1129,7 +1129,7 @@ export function get_search_result(
suggestion_line = [
{
search_string: last.operand,
- description_html: search_term_description_html(last),
+ description_html: search_term_description_html(last.operand),
},
];
attacher.push([...attacher.base, ...suggestion_line]);