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.

eslint: Fix unicorn/no-unnecessary-array-flat-map.

Anders Kaseorgc6fbf10df06e
diff --git a/web/src/channel_folders_ui.ts b/web/src/channel_folders_ui.ts
index bddbb08c2ec..51c7a6b0903 100644
--- a/web/src/channel_folders_ui.ts
+++ b/web/src/channel_folders_ui.ts
@@ -277,17 +277,12 @@ function get_edit_modal_folder_id_if_open(): number | undefined {
function get_channel_folder_candidates(folder_id: number): dropdown_widget.Option[] {
return stream_data
.get_unsorted_subs()
- .flatMap((stream) =>
- stream.folder_id !== folder_id
- ? [
- {
- name: stream.name,
- unique_id: stream.stream_id,
- stream,
- },
- ]
- : [],
- )
+ .filter((stream) => stream.folder_id !== folder_id)
+ .map((stream) => ({
+ name: stream.name,
+ unique_id: stream.stream_id,
+ stream,
+ }))
.toSorted((a, b) => util.compare_stream_by_archived_then_name(a.stream, b.stream));
}