Skip to content

Commit

Permalink
fix: disallow slecting contacts (ref #711)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankParticle committed Aug 29, 2024
1 parent 720d960 commit 422e5d2
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,16 @@ function ParticipantsComboboxPopover({
keywords={participant.keywords}
onSelect={(value) => {
if (participant.own) return;
if (
disabled &&
// Allow un-selecting if already selected somehow
!selectedParticipants.find(
(_) => _.publicId === participant.publicId
) &&
(participant.type === 'contact' ||
participant.type === 'email')
)
return showDisabledMessage();
setSelectedParticipants((prev) =>
prev.find((p) => p.publicId === value)
? prev.filter((p) => p.publicId !== value)
Expand Down

0 comments on commit 422e5d2

Please sign in to comment.