Skip to content

Commit

Permalink
....and filter by the ones that already exist in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Jul 24, 2024
1 parent 7d4c46f commit e670998
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/custom-lists/ui/space-email-invites/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ export default class SpaceEmailInvitesLogic extends UILogic<State, Event> {
.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
Expand Down

0 comments on commit e670998

Please sign in to comment.