From 89b4752fd0c0c71e5e7dba299bd624d4ae6aadf3 Mon Sep 17 00:00:00 2001 From: Caleb Alldrin Date: Fri, 13 Dec 2024 08:40:12 -0800 Subject: [PATCH] Simplify array sort --- .../MassActions/RemoveTags/MassActionsRemoveTagsModal.tsx | 4 +--- .../RemoveTags/MassActionsTasksRemoveTagsModal.tsx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Contacts/MassActions/RemoveTags/MassActionsRemoveTagsModal.tsx b/src/components/Contacts/MassActions/RemoveTags/MassActionsRemoveTagsModal.tsx index c5e798a20..9b25e7f8e 100644 --- a/src/components/Contacts/MassActions/RemoveTags/MassActionsRemoveTagsModal.tsx +++ b/src/components/Contacts/MassActions/RemoveTags/MassActionsRemoveTagsModal.tsx @@ -108,9 +108,7 @@ export const MassActionsRemoveTagsModal: React.FC< const tagsData = contactsForTags?.contacts.nodes.map((contact) => contact.tagList) ?? []; - const contactsTagsList = [ - ...new Set([...tagsData.flatMap((el) => el)]), - ].sort(); + const contactsTagsList = Array.from(new Set(tagsData.flat())).sort(); return ( diff --git a/src/components/Task/MassActions/RemoveTags/MassActionsTasksRemoveTagsModal.tsx b/src/components/Task/MassActions/RemoveTags/MassActionsTasksRemoveTagsModal.tsx index 072c499ad..706c53f82 100644 --- a/src/components/Task/MassActions/RemoveTags/MassActionsTasksRemoveTagsModal.tsx +++ b/src/components/Task/MassActions/RemoveTags/MassActionsTasksRemoveTagsModal.tsx @@ -116,9 +116,7 @@ export const MassActionsTasksRemoveTagsModal: React.FC< const tagsData = tasksForTags?.tasks.nodes.map((task) => task.tagList) ?? []; - const contactsTagsList = [ - ...new Set([...tagsData.flatMap((el) => el)]), - ].sort(); + const contactsTagsList = Array.from(new Set(tagsData.flat())).sort(); return (