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.

user_profile: Use strcmp to sort in user channel subscribe widget.

Pratik Chandac4842fc95623
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index 69d8e9c9aa5..b3316f1a0de 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -282,15 +282,7 @@ function get_fetched_user_unsub_streams(user_id: number): dropdown_widget.Option
unique_id: stream.stream_id,
stream,
}))
- .toSorted((a, b) => {
- if (a.name.toLowerCase() < b.name.toLowerCase()) {
- return -1;
- }
- if (a.name.toLowerCase() > b.name.toLowerCase()) {
- return 1;
- }
- return 0;
- });
+ .toSorted((a, b) => compare_by_name(a.stream, b.stream));
}
function format_user_stream_list_item_html(stream: StreamSubscription, user: User): string {