mirror of
https://github.com/aljazceru/nostr-profile-manager.git
synced 2025-12-18 22:24:19 +01:00
improve display of contact names
This commit is contained in:
@@ -275,8 +275,11 @@ export const getContactName = (pubkey: string):string => {
|
||||
// their kind 0 name
|
||||
if (UserProfileEvents[pubkey]) {
|
||||
if (UserProfileEvents[pubkey][0]) {
|
||||
const { name } = JSON.parse(UserProfileEvents[pubkey][0].content);
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { name, display_name } = JSON.parse(UserProfileEvents[pubkey][0].content);
|
||||
if (name) return name;
|
||||
// name isn't present for Jack Dorsey and Vitor from Amethyst in Apr 2023.
|
||||
if (display_name) return display_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user