fix: display name

This commit is contained in:
2024-09-13 11:44:05 +01:00
parent 1ef968e184
commit ae943ce173

View File

@ -13,8 +13,8 @@ interface DisplayNameProps {
} }
const DisplayName = ({ pubkey, user }: DisplayNameProps) => { const DisplayName = ({ pubkey, user }: DisplayNameProps) => {
const profile = useUserProfile(user ? undefined : pubkey); const profile = useUserProfile(user ? undefined : pubkey) ?? user;
const [name, isPlaceHolder] = useMemo(() => getDisplayNameOrPlaceHolder(profile ?? user, pubkey), [profile, pubkey]); const [name, isPlaceHolder] = useMemo(() => getDisplayNameOrPlaceHolder(profile, pubkey), [profile, pubkey]);
return <span className={classNames({ placeholder: isPlaceHolder })}>{name}</span>; return <span className={classNames({ placeholder: isPlaceHolder })}>{name}</span>;
}; };