From 1db46f4aac8ddeeee165767b44ed1f5251580e8f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 31 May 2024 16:45:54 -0400 Subject: [PATCH] fix: Change to 'No access' is not persisted in collection sharing dialog --- app/components/Sharing/Collection/SharePopover.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/Sharing/Collection/SharePopover.tsx b/app/components/Sharing/Collection/SharePopover.tsx index 3bbbfb3d4..c20ddc2a2 100644 --- a/app/components/Sharing/Collection/SharePopover.tsx +++ b/app/components/Sharing/Collection/SharePopover.tsx @@ -21,7 +21,7 @@ import useCurrentTeam from "~/hooks/useCurrentTeam"; import useKeyDown from "~/hooks/useKeyDown"; import usePolicy from "~/hooks/usePolicy"; import useStores from "~/hooks/useStores"; -import { Permission } from "~/types"; +import { EmptySelectValue, Permission } from "~/types"; import { collectionPath, urlify } from "~/utils/routeHelpers"; import { Wrapper, presence } from "../components"; import { CopyLinkButton } from "../components/CopyLinkButton"; @@ -322,8 +322,12 @@ function SharePopover({ collection, visible, onRequestClose }: Props) {
{ - void collection.save({ permission }); + onChange={( + value: CollectionPermission | typeof EmptySelectValue + ) => { + void collection.save({ + permission: value === EmptySelectValue ? null : value, + }); }} disabled={!can.update} value={collection?.permission}