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.

typeahead: Use null check for user comma insertion.

apoorvapendse058347ce5990
diff --git a/web/src/typeahead_helper.ts b/web/src/typeahead_helper.ts
index 19c6a25dd78..1a4bd368fb1 100644
--- a/web/src/typeahead_helper.ts
+++ b/web/src/typeahead_helper.ts
@@ -114,7 +114,7 @@ export let render_typeahead_item = (args: {
}): string => {
const has_image = args.img_src !== undefined;
const has_status = args.status_emoji_info !== undefined;
- const has_secondary = args.secondary !== undefined;
+ const has_secondary = args.secondary !== undefined && args.secondary !== null;
const has_secondary_html = args.secondary_html !== undefined;
const has_pronouns = args.pronouns !== undefined;
return render_typeahead_list_item({
@@ -163,7 +163,6 @@ export let render_person = (person: UserPillData | UserOrMentionPillData): strin
),
pronouns,
secondary: person.user.delivery_email,
- show_comma: person.user.delivery_email !== null,
};
return render_typeahead_item(typeahead_arguments);
diff --git a/web/templates/typeahead_list_item.hbs b/web/templates/typeahead_list_item.hbs
index ad21b0db176..5473b5fd07e 100644
--- a/web/templates/typeahead_list_item.hbs
+++ b/web/templates/typeahead_list_item.hbs
@@ -48,7 +48,7 @@
{{> status_emoji status_emoji_info}}
{{~/if}}
{{~#if has_pronouns}}
- <span class="pronouns">{{pronouns}}{{#if (or has_secondary_html show_comma)}},{{/if}}</span>
+ <span class="pronouns">{{pronouns}}{{#if (or has_secondary_html has_secondary)}},{{/if}}</span>
{{~/if}}
{{~#if has_secondary_html}}
<span class="autocomplete_secondary rendered_markdown single-line-rendered-markdown">{{rendered_markdown secondary_html}}</span>