Skip to content

Commit 97d8def

Browse files
fix followers check
1 parent 64a5267 commit 97d8def

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/app/[user]/hooks/use-user-profile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const useUser = (user: string) => {
7878
search: followingSearch,
7979
})
8080

81-
if (fetchedFollowing.following.length === 0) setIsEndOfFollowing(true)
81+
if (fetchedFollowing.following?.length === 0) setIsEndOfFollowing(true)
8282

8383
return fetchedFollowing
8484
},
@@ -122,7 +122,7 @@ const useUser = (user: string) => {
122122
search: followersSearch,
123123
})
124124

125-
if (fetchedFollowers.followers.length === 0) setIsEndOfFollowers(true)
125+
if (fetchedFollowers.followers?.length === 0) setIsEndOfFollowers(true)
126126

127127
return fetchedFollowers
128128
},

src/app/[user]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export async function generateMetadata(props: Props): Promise<Metadata> {
2828
const getAccount = async () => {
2929
try {
3030
if (ssr) {
31-
return await fetchAccount(user, isList ? Number(user) : undefined)
31+
const response = await fetchAccount(user, isList ? Number(user) : undefined)
32+
if(!response?.address) return null
33+
return response
3234
}
3335

3436
return null

0 commit comments

Comments
 (0)