Skip to content

Commit

Permalink
fix: account profile
Browse files Browse the repository at this point in the history
  • Loading branch information
aeolianeth committed Jul 3, 2024
1 parent 149561e commit 8a119d9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pages/account/[addressOrEnsName]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function useEnsNamePair(addressOrEnsName: string | undefined) {
if (!addressOrEnsName) return

const data = await resolveAddress(addressOrEnsName)
if (!data && isAddress(addressOrEnsName)) {
return { address: addressOrEnsName, name: null }
}

return data
},
})
Expand All @@ -45,8 +49,12 @@ function _AccountPage({ addressOrEnsName }: { addressOrEnsName: string }) {

const { data: profile } = useAccount({ address })

if (ensLoading) return <Loading />
if (!address) return null
if (ensLoading) {
return <Loading />
}
if (!address) {
return <div className="text-center">No address given.</div>
}

return (
<>
Expand Down

0 comments on commit 8a119d9

Please sign in to comment.