From 24b21a9451c07943016bc73495d9c11e6f1ac504 Mon Sep 17 00:00:00 2001 From: reya Date: Sat, 25 Nov 2023 16:03:05 +0700 Subject: [PATCH] update --- src/app/users/components/profile.tsx | 12 ++++++------ src/shared/nip05.tsx | 1 - src/shared/user.tsx | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/app/users/components/profile.tsx b/src/app/users/components/profile.tsx index 323dc4c0..a1e2e21b 100644 --- a/src/app/users/components/profile.tsx +++ b/src/app/users/components/profile.tsx @@ -21,8 +21,8 @@ export function UserProfile({ pubkey }: { pubkey: string }) { const { user } = useProfile(pubkey); const [followed, setFollowed] = useState(false); - const navigate = useNavigate(); + const navigate = useNavigate(); const svgURI = 'data:image/svg+xml;utf8,' + encodeURIComponent(minidenticon(pubkey, 90, 50)); @@ -78,9 +78,9 @@ export function UserProfile({ pubkey }: { pubkey: string }) { return ( <>
- {user.banner ? ( + {user?.banner ? ( user banner @@ -112,10 +112,10 @@ export function UserProfile({ pubkey }: { pubkey: string }) {
{user.name || user.display_name || user.displayName || 'No name'}
- {user.nip05 ? ( + {user?.nip05 ? ( ) : ( @@ -125,7 +125,7 @@ export function UserProfile({ pubkey }: { pubkey: string }) { )}
- {user.about || user.bio ? ( + {user?.about || user?.bio ? (

{user.about || user.bio}

diff --git a/src/shared/nip05.tsx b/src/shared/nip05.tsx index 45f5164f..e9cc7ee9 100644 --- a/src/shared/nip05.tsx +++ b/src/shared/nip05.tsx @@ -39,7 +39,6 @@ export const NIP05 = memo(function NIP05({ if (!res.ok) throw new Error(`Failed to fetch NIP-05 service: ${nip05}`); const data: NIP05 = await res.json(); - if (data.names) { if (data.names[localPath] !== pubkey) return false; return true; diff --git a/src/shared/user.tsx b/src/shared/user.tsx index e2b1a0c5..693d1d07 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -222,7 +222,7 @@ export const User = memo(function User({ {user?.name || user?.display_name || user?.displayName}

- {user?.nip05 || user?.username || displayNpub(pubkey, 16)} + {user?.username || displayNpub(pubkey, 16)}

@@ -551,7 +551,7 @@ export const User = memo(function User({ {user?.nip05 ? ( ) : (