From 8061ca2608e3e535d34f4c3f3df079b761b98ea2 Mon Sep 17 00:00:00 2001 From: ectasy663 Date: Tue, 22 Sep 2026 19:05:52 +0530 Subject: [PATCH] Fix React useEffect missing dependency causing infinite loader on Dashboard --- src/app/dashboard/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 36de62b..b6ff07a 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -25,7 +25,7 @@ export default function DashboardPage() { } async function fetchStats() { try { - const res = await fetch(`/api/users/${userId}/stats`) + const res = await fetch(`/api/users/${currentUserId}/stats`) if (res.ok) { const data = await res.json() setUserStats(data) @@ -37,7 +37,7 @@ export default function DashboardPage() { } } fetchStats() - }, [user?.id]) + }, [userLoading, user?.id, userId]) const handleExport = async () => { try {