From bd4a095fc3c495ba30cb833b7566ffa7e5cde8d8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 27 Mar 2024 13:56:09 -0700 Subject: [PATCH] inbox_ui: Sort names, not HTML. Signed-off-by: Anders Kaseorg --- web/src/inbox_ui.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/web/src/inbox_ui.js b/web/src/inbox_ui.js index 15f3b26f81..61500bd88e 100644 --- a/web/src/inbox_ui.js +++ b/web/src/inbox_ui.js @@ -170,13 +170,12 @@ function format_dm(user_ids_string, unread_count, latest_msg_id) { const reply_to = people.user_ids_string_to_emails_string(user_ids_string); const rendered_dm_with = recipient_ids - .map((recipient_id) => - render_user_with_status_icon({ - name: people.get_display_full_name(recipient_id), - status_emoji_info: user_status.get_status_emoji(recipient_id), - }), - ) - .sort(); + .map((recipient_id) => ({ + name: people.get_display_full_name(recipient_id), + status_emoji_info: user_status.get_status_emoji(recipient_id), + })) + .sort((a, b) => util.strcmp(a.name, b.name)) + .map((user_info) => render_user_with_status_icon(user_info)); let user_circle_class; let is_bot = false;