From e67099898e62159f4d31f7face0e9afb02403445 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 24 Jul 2024 17:33:35 +0200 Subject: [PATCH] ....and filter by the ones that already exist in the list --- src/custom-lists/ui/space-email-invites/logic.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/custom-lists/ui/space-email-invites/logic.ts b/src/custom-lists/ui/space-email-invites/logic.ts index 4de0510e11..2883d91eff 100644 --- a/src/custom-lists/ui/space-email-invites/logic.ts +++ b/src/custom-lists/ui/space-email-invites/logic.ts @@ -161,6 +161,13 @@ export default class SpaceEmailInvitesLogic extends UILogic { .split(',') .map((email) => email.trim()) .filter((email) => !isValidEmail(email)) // Filter out invalid emails + .filter( + (email) => + !event.state.emailInvites.allIds.some( + (id) => + event.state.emailInvites.byId[id].email === email, + ), + ) // Filter out emails already on the list const roleID = event.state.emailInviteInputRole let prevInviteCount = event.state.emailInvites.allIds.length