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.

narrow_banner: Use user_id directly instead of get_by_user_id.

Aman Agrawal6f1a02988d81
diff --git a/web/src/narrow_banner.ts b/web/src/narrow_banner.ts
index 70b0615bfe6..ff7184d4ede 100644
--- a/web/src/narrow_banner.ts
+++ b/web/src/narrow_banner.ts
@@ -379,9 +379,9 @@ export function pick_empty_narrow_banner(current_filter: Filter): NarrowBannerDa
};
}
if (user_ids.length === 1) {
- const recipient_user = people.get_by_user_id(user_ids[0]);
+ const user_id = user_ids[0];
// You have no direct messages with this person
- if (people.is_my_user_id(recipient_user.user_id)) {
+ if (people.is_my_user_id(user_id)) {
return {
title: $t({
defaultMessage: "You haven't sent yourself any notes yet!",
@@ -393,13 +393,13 @@ export function pick_empty_narrow_banner(current_filter: Filter): NarrowBannerDa
};
}
// If the recipient is deactivated, we cannot start the conversation.
- if (!people.is_person_active(recipient_user.user_id)) {
+ if (!people.is_person_active(user_id)) {
return {
title: $t(
{
defaultMessage: "You have no direct messages with {person}.",
},
- {person: recipient_user.full_name},
+ {person: people.get_full_name(user_id)},
),
};
}
@@ -408,7 +408,7 @@ export function pick_empty_narrow_banner(current_filter: Filter): NarrowBannerDa
{
defaultMessage: "You have no direct messages with {person} yet.",
},
- {person: recipient_user.full_name},
+ {person: people.get_full_name(user_id)},
),
html: $t_html(
{