mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
compose_box: Fix order of group pm recipient pills on focus.
Earlier when compose box was opened or narrowed to pm, the recipient pills were sorted according to user email strings instead of their full names which was inconsistent with compose box placeholder text, recipient row and message header. This commit fixes the behaviour by introducing a `sort_email` function to sort emails according to their full names and display sorted pills. Fixes: zulip#27375. Co-authored-by: richardshaju <richardshaju66@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
c180b25a68
commit
64a9f83473
@@ -354,9 +354,10 @@ export function restore_message(draft: LocalStorageDraft): ComposeArguments {
|
||||
const recipient_emails = draft.private_message_recipient
|
||||
.split(",")
|
||||
.filter((email) => people.is_valid_email_for_compose(email));
|
||||
const sorted_recipient_emails = people.sort_emails_by_username(recipient_emails);
|
||||
return {
|
||||
type: "private",
|
||||
private_message_recipient: recipient_emails.join(","),
|
||||
private_message_recipient: sorted_recipient_emails.join(","),
|
||||
content: draft.content,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user