Make nip05 name take priority over profile.name

This commit is contained in:
artur
2024-02-22 14:21:24 +03:00
parent 905dc7ac1b
commit 8c0b5f379e
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ export const useProfile = (npub: string) => {
const [profile, setProfile] = useState<MetaEvent | null>(null)
const currentKey = useAppSelector((state) => selectKeyByNpub(state, npub))
const userName = getProfileUsername(profile) || currentKey?.name
const userName = currentKey?.name || getProfileUsername(profile)
const userAvatar = profile?.info?.picture || ''
const avatarTitle = getFirstLetter(userName)

View File

@@ -16,7 +16,7 @@ export const getShortenNpub = (npub = '') => {
}
export const getProfileUsername = (profile: MetaEvent | null) => {
if (!profile) return null
if (!profile) return undefined
return profile?.info?.name || profile?.info?.display_name
}