Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

🐛 fix: fix multiple fetchign api/me

Dillion Vermafc19084e3ea0
diff --git a/components/component-source.tsx b/components/component-source.tsx
index f2741ef7..a5a8da2c 100644
--- a/components/component-source.tsx
+++ b/components/component-source.tsx
@@ -17,7 +17,10 @@ export function ComponentSource({
...props
}: ComponentSourceProps) {
const { data: session, status } = useSession();
- const { data, isLoading } = useSWR("/api/me", fetcher);
+ const { data, isLoading } = useSWR(
+ status === "authenticated" && "/api/me",
+ fetcher
+ );
if (status === "loading") return null;
if (status === "unauthenticated") return <PreOrder />;