From 4b1b87abde3c7814a9868753ca3bae64c25e6c62 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 29 May 2024 20:04:20 -0400 Subject: [PATCH] fix: Cannot remove user from collection in beta sharing UI --- .../Sharing/Collection/CollectionMemberList.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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}