From bf6bd3f8d0eb580dd477bd1d27ed9e8fa8db2136 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 25 Oct 2023 20:50:09 -0400 Subject: [PATCH] Allow share record creation when disabled at team level for private sharing --- app/scenes/Document/components/SharePopover.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/scenes/Document/components/SharePopover.tsx b/app/scenes/Document/components/SharePopover.tsx index 48112639c..ef95a9f4e 100644 --- a/app/scenes/Document/components/SharePopover.tsx +++ b/app/scenes/Document/components/SharePopover.tsx @@ -74,13 +74,13 @@ function SharePopover({ useKeyDown("Escape", onRequestClose); React.useEffect(() => { - if (visible && team.sharing) { + if (visible) { void document.share(); buttonRef.current?.focus(); } return () => (timeout.current ? clearTimeout(timeout.current) : undefined); - }, [document, visible, team.sharing]); + }, [document, visible]); React.useEffect(() => { if (!visible) { @@ -201,11 +201,9 @@ function SharePopover({ const userLocale = useUserLocale(); const locale = userLocale ? dateLocale(userLocale) : undefined; - let shareUrl = team.sharing - ? sharedParent?.url - ? `${sharedParent.url}${document.url}` - : share?.url ?? "" - : `${team.url}${document.url}`; + let shareUrl = sharedParent?.url + ? `${sharedParent.url}${document.url}` + : share?.url ?? ""; if (isEditMode) { shareUrl += "?edit=true"; } @@ -328,7 +326,7 @@ function SharePopover({