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.

eslint: Fix unicorn/no-unnecessary-string-trim.

Anders Kaseorgcf5800a3fc61
diff --git a/web/src/pill_typeahead.ts b/web/src/pill_typeahead.ts
index 3e9f3617849..86ce6ef1329 100644
--- a/web/src/pill_typeahead.ts
+++ b/web/src/pill_typeahead.ts
@@ -276,7 +276,7 @@ export function set_up_combined(
return;
}
const include_streams = (query: string): boolean =>
- opts.stream !== undefined && query.trim().startsWith("#");
+ opts.stream !== undefined && query.trimStart().startsWith("#");
const include_user_groups = opts.user_group;
const include_users = opts.user;
const exclude_bots = opts.exclude_bots;
diff --git a/web/src/search_pill.ts b/web/src/search_pill.ts
index 7784cfe9677..72307a51765 100644
--- a/web/src/search_pill.ts
+++ b/web/src/search_pill.ts
@@ -235,7 +235,7 @@ export function generate_pills_html(suggestion: Suggestion, text_query: string):
text_query === "" ||
index < search_terms.length - 1 ||
// case 2
- text_query.trim().endsWith("topic:")
+ text_query.trimEnd().endsWith("topic:")
) {
// We want to show a combined pill for the case
// where the preceding operator is a `channel`.