Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: don't swr groups if it's not a dataroom

Marc Seitzdbc5415a2b86
diff --git a/lib/swr/use-dataroom-groups.ts b/lib/swr/use-dataroom-groups.ts
index f8385ac0..309f8284 100644
--- a/lib/swr/use-dataroom-groups.ts
+++ b/lib/swr/use-dataroom-groups.ts
@@ -12,8 +12,12 @@ import useSWR from "swr";
import { fetcher } from "@/lib/utils";
export default function useDataroomGroups() {
- const teamInfo = useTeam();
+ // if not on dataroom page, return
const router = useRouter();
+ const isDataroom = router.pathname.includes("datarooms");
+ if (!isDataroom) return { viewerGroups: [], loading: false, error: null };
+
+ const teamInfo = useTeam();
const { id } = router.query as {
id: string;
};