From 4fd00f7b975f779dc8a9278b414848a645985ba5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 23 Jan 2024 20:15:54 -0500 Subject: [PATCH] fix: Remove disabled public sharing control for those without access --- app/components/Sharing/SharePopover.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/Sharing/SharePopover.tsx b/app/components/Sharing/SharePopover.tsx index cc6a61f408..554dcdd977 100644 --- a/app/components/Sharing/SharePopover.tsx +++ b/app/components/Sharing/SharePopover.tsx @@ -16,6 +16,7 @@ import Text from "~/components/Text"; import useCurrentTeam from "~/hooks/useCurrentTeam"; import useCurrentUser from "~/hooks/useCurrentUser"; import useKeyDown from "~/hooks/useKeyDown"; +import usePolicy from "~/hooks/usePolicy"; import useRequest from "~/hooks/useRequest"; import useStores from "~/hooks/useStores"; import { documentPath, urlify } from "~/utils/routeHelpers"; @@ -68,6 +69,7 @@ function SharePopover({ const user = useCurrentUser(); const team = useCurrentTeam(); const { t } = useTranslation(); + const can = usePolicy(document); const timeout = React.useRef>(); const buttonRef = React.useRef(null); const collection = document.collection; @@ -177,7 +179,7 @@ function SharePopover({ )} - {team.sharing && visible && ( + {team.sharing && visible && can.share && ( <> {t("Public access")}