fix: display name

This commit is contained in:
kieran 2024-09-13 11:44:05 +01:00
parent 1ef968e184
commit ae943ce173
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

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