fix(profile): add npub to hex conversion in link
This commit is contained in:
parent
e321861fc4
commit
01ca102dcc
@ -587,18 +587,17 @@ type ProfileLinkProps = {
|
||||
}
|
||||
export const ProfileLink = ({ pubkey, nip05 }: ProfileLinkProps) => {
|
||||
const { ndk } = useNDKContext()
|
||||
console.log(`[debug]`, pubkey, nip05)
|
||||
const [hexPubkey, setHexPubkey] = useState<string>()
|
||||
const profile = useProfile(hexPubkey, {
|
||||
cacheUsage: NDKSubscriptionCacheUsage.PARALLEL
|
||||
})
|
||||
useEffect(() => {
|
||||
if (pubkey) {
|
||||
setHexPubkey(pubkey)
|
||||
setHexPubkey(npubToHex(pubkey)!)
|
||||
} else if (nip05) {
|
||||
NDKUser.fromNip05(nip05, ndk).then((user) => {
|
||||
if (user?.pubkey) {
|
||||
setHexPubkey(user.pubkey)
|
||||
setHexPubkey(npubToHex(user.pubkey)!)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user