Skip to content

Commit 5dc683c

Browse files
authored
Merge pull request #841 from dacadeorg/fix/parse-error-on-profile
fix: PARSE_ERROR when fetching the user profile
2 parents c1c9b84 + 0563447 commit 5dc683c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/contexts/AuthObserver.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ export default function AuthObserver({ children }: { children: ReactNode }) {
7575

7676
if (route.startsWith("/profile") && auth && auth.emailVerified) {
7777
const username = (router.query.username as string) || user?.username || "";
78-
dispatch(fetchUserProfile(username));
79-
dispatch(fetchAllProfileCommunities(auth?.displayName || ""));
78+
if (username) {
79+
dispatch(fetchUserProfile(username));
80+
dispatch(fetchAllProfileCommunities(auth?.displayName || ""));
81+
}
8082
}
8183

8284
if (route.startsWith("/profile")) {

0 commit comments

Comments
 (0)