From e507f09ff9cd41ae10c6f5bf24530ff1707c0f27 Mon Sep 17 00:00:00 2001 From: Apoorv Mishra Date: Mon, 1 Jul 2024 19:40:35 +0530 Subject: [PATCH] fix: collection permission check (#7171) --- app/components/Collection/CollectionForm.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/Collection/CollectionForm.tsx b/app/components/Collection/CollectionForm.tsx index b567e36ed..72af44c1b 100644 --- a/app/components/Collection/CollectionForm.tsx +++ b/app/components/Collection/CollectionForm.tsx @@ -18,6 +18,7 @@ import Switch from "~/components/Switch"; import Text from "~/components/Text"; import useBoolean from "~/hooks/useBoolean"; import useCurrentTeam from "~/hooks/useCurrentTeam"; +import { EmptySelectValue } from "~/types"; import { Feature, FeatureFlags } from "~/utils/FeatureFlags"; const IconPicker = React.lazy(() => import("~/components/IconPicker")); @@ -142,8 +143,10 @@ export const CollectionForm = observer(function CollectionForm_({ { - field.onChange(value); + onChange={( + value: CollectionPermission | typeof EmptySelectValue + ) => { + field.onChange(value === EmptySelectValue ? null : value); }} note={t( "The default access for workspace members, you can share with more users or groups later."