Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(sharing): disable public link toggle for folders (#5149)

gbirman09d03857b9ec
diff --git a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx b/apps/web/src/lib/core/component/TopBar/ShareButton.tsx
index 8f60f00402..daa4266135 100644
--- a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx
+++ b/apps/web/src/lib/core/component/TopBar/ShareButton.tsx
@@ -92,6 +92,9 @@ import { openLoginModal } from './LoginButton';
false && clickOutside;
+const isPublicLinkDisabledForItem = (itemType: ItemType): boolean =>
+ itemType === 'email' || itemType === 'project';
+
interface IShareDialogContext {
isOpen: Accessor<boolean>;
open: () => void;
@@ -295,7 +298,7 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {
tabs.push({ value: 'people', label: 'People' });
if (
props.userPermissions === Permissions.OWNER &&
- props.itemType !== 'email'
+ !isPublicLinkDisabledForItem(props.itemType)
)
tabs.push({ value: 'link', label: 'Link' });
return tabs;
@@ -1130,7 +1133,7 @@ export function ShareModal(props: ShareModalProps) {
<Show
when={
props.userPermissions === Permissions.OWNER &&
- props.itemType !== 'email'
+ !isPublicLinkDisabledForItem(props.itemType)
}
>
<Panel depth={2} class="rounded-xl">