mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
drafts: Fix order of group pm recipients in draft overlay.
Earlier in drafts overlay, the order of pm recipients for the draft was sorted differently to that of the pm group title. This commit fixes the behaviour by sorting the drafts pm recipients using `make_strcmp`. Fixes part of zulip#27375. Co-authored-by: richardshaju <richardshaju66@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
eeae434625
commit
c180b25a68
@@ -324,16 +324,17 @@ export function reply_to_to_user_ids_string(emails_string: string): string | und
|
||||
}
|
||||
|
||||
export function emails_to_full_names_string(emails: string[]): string {
|
||||
return emails
|
||||
.map((email) => {
|
||||
email = email.trim();
|
||||
const person = get_by_email(email);
|
||||
if (person !== undefined) {
|
||||
return person.full_name;
|
||||
}
|
||||
return INACCESSIBLE_USER_NAME;
|
||||
})
|
||||
.join(", ");
|
||||
const names = emails.map((email) => {
|
||||
email = email.trim();
|
||||
const person = get_by_email(email);
|
||||
if (person !== undefined) {
|
||||
return person.full_name;
|
||||
}
|
||||
return INACCESSIBLE_USER_NAME;
|
||||
});
|
||||
|
||||
const sorted_names = names.sort(util.make_strcmp());
|
||||
return sorted_names.join(", ");
|
||||
}
|
||||
|
||||
export function get_user_time(user_id: number): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user