Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix bulk actions for users w/o access to folders

Tim Wilson243093d9de65
diff --git a/apps/web/ui/links/links-toolbar.tsx b/apps/web/ui/links/links-toolbar.tsx
index 47adcc25f4..92e4831602 100644
--- a/apps/web/ui/links/links-toolbar.tsx
+++ b/apps/web/ui/links/links-toolbar.tsx
@@ -66,6 +66,9 @@ export const LinksToolbar = memo(
);
const hasAllFolderPermissions = useMemo(() => {
+ // `folders` is undefined for users without access, so just check if all links are not in a folder first
+ if (selectedLinks.every((link) => !link.folderId)) return true;
+
if (!folders || !Array.isArray(folders)) return false;
return selectedLinks.every(