move messages: Use case-insensitive sorting in stream selection.

Previously, the options in the stream selection dropdown were sorted in a case-sensitive
fashion, which felt a bit harder to use than just sorting alphabetically irrespective of case.

Fixes: #23283
This commit is contained in:
Rebeca Carvalho 2022-12-09 16:19:48 -03:00 committed by GitHub
parent f554af0d1c
commit a516a13220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -421,7 +421,16 @@ export function get_available_streams_for_moving_messages(current_stream_id) {
.map((stream) => ({
name: stream.name,
value: stream.stream_id.toString(),
}));
}))
.sort((a, b) => {
if (a.name.toLowerCase() < b.name.toLowerCase()) {
return -1;
}
if (a.name.toLowerCase() > b.name.toLowerCase()) {
return 1;
}
return 0;
});
}
function edit_message($row, raw_content) {