diff --git a/app/components/Sharing/Collection/CollectionMemberList.tsx b/app/components/Sharing/Collection/CollectionMemberList.tsx index d05500d13..c67c70913 100644 --- a/app/components/Sharing/Collection/CollectionMemberList.tsx +++ b/app/components/Sharing/Collection/CollectionMemberList.tsx @@ -146,18 +146,20 @@ function CollectionMemberList({ collection, invitedInSession }: Props) { { - if (permission) { + onChange={async ( + permission: CollectionPermission | typeof EmptySelectValue + ) => { + if (permission === EmptySelectValue) { + await memberships.delete({ + collectionId: collection.id, + userId: membership.userId, + }); + } else { await memberships.create({ collectionId: collection.id, userId: membership.userId, permission, }); - } else { - await memberships.delete({ - collectionId: collection.id, - userId: membership.userId, - }); } }} disabled={!can.update}