From cf643b22af218dc25c0785d57532d5079b7b991c Mon Sep 17 00:00:00 2001 From: "Amy J. Ko" Date: Thu, 19 Dec 2024 20:37:41 -0800 Subject: [PATCH] Filtered lead duplicates. --- src/lib/Changes.svelte | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lib/Changes.svelte b/src/lib/Changes.svelte index 409c2b0..63ad97c 100644 --- a/src/lib/Changes.svelte +++ b/src/lib/Changes.svelte @@ -145,16 +145,12 @@ selection={filterLead} options={[ { value: undefined, label: 'All' }, - ...changes - .map((change) => - change.lead === null - ? null - : { - value: change.lead, - label: org.getProfileNameOrEmail(change.lead) ?? '—' - } - ) - .filter((change) => change !== null) + ...[...new Set(changes.map((change) => change.lead))] + .filter((lead) => lead !== null) + .map((lead) => ({ + value: lead, + label: org.getProfileNameOrEmail(lead) ?? '—' + })) ]} change={(value) => (filterLead = value)} />