From 1e85683570d2ee63e1edafa29180eea0b2ce3e8b Mon Sep 17 00:00:00 2001 From: Palash Baderia Date: Tue, 11 Oct 2022 17:50:27 +0530 Subject: [PATCH] user_profile: Sort the stream list on update. This commit fixes the issue of reordering the stream list when the user unsubscribes from a stream. The issue was caused because, on rendering, we sorted the list by name but did not sort it while updating the stream list on any update. --- web/src/user_profile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/user_profile.js b/web/src/user_profile.js index 481536306d..7c8d9327bf 100644 --- a/web/src/user_profile.js +++ b/web/src/user_profile.js @@ -46,6 +46,7 @@ export function update_user_profile_streams_list_for_users(user_ids) { const user_id = get_user_id_if_user_profile_modal_open(); if (user_id && user_ids.includes(user_id) && user_streams_list_widget !== undefined) { const user_streams = stream_data.get_streams_for_user(user_id).subscribed; + user_streams.sort(compare_by_name); user_streams_list_widget.replace_list_data(user_streams); } }