From 1cf6711fe258829b000325ad4775c06d7c2e8375 Mon Sep 17 00:00:00 2001 From: belong112 Date: Sat, 21 Dec 2024 01:53:27 +0800 Subject: [PATCH] fix(ProfilePage): should see other users profile page --- components/ProfilePage/ProfilePage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ProfilePage/ProfilePage.js b/components/ProfilePage/ProfilePage.js index 63f8b141..28db2fa1 100644 --- a/components/ProfilePage/ProfilePage.js +++ b/components/ProfilePage/ProfilePage.js @@ -89,9 +89,9 @@ function ProfilePage({ id, slug }) { // const router = useRouter(); const latestSlug = data?.GetUser?.slug; // slug may update after user edits - const userId = currentUser?.id; + const userId = data?.GetUser?.id; useEffect(() => { - if (latestSlug === undefined) return; + if (!latestSlug && latestSlug !== '') return; const targetPath = latestSlug ? `/user/${encodeURI(latestSlug)}` : `/user?id=${userId}`;