Skip to content

Commit

Permalink
Merge pull request #588 from belong112/bugfix/issue#587
Browse files Browse the repository at this point in the history
fix(ProfilePage): should see other users' profile page
  • Loading branch information
MrOrz authored Dec 22, 2024
2 parents d5a4be4 + 1cf6711 commit 9f97ed6
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 9f97ed6

Please sign in to comment.