Skip to content

Commit

Permalink
fix(ProfilePage): should see other users profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
belong112 committed Dec 20, 2024
1 parent d5a4be4 commit 1cf6711
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ProfilePage/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit 1cf6711

Please sign in to comment.