bug: follows you

This commit is contained in:
Kieran 2023-02-24 19:28:29 +00:00
parent 40bd552994
commit 70db025ed2
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 6 additions and 4 deletions

View File

@ -19,10 +19,12 @@ export default function useFollowsFeed(pubkey: HexKey) {
}, [isMe, pubkey]);
const contactFeed = useSubscription(sub, { leaveOpen: false, cache: true });
const following = useMemo(() => {
return useMemo(() => {
if (isMe) {
return follows;
}
return getFollowing(contactFeed.store.notes ?? [], pubkey);
}, [contactFeed.store.notes]);
return isMe ? follows : following;
}, [contactFeed.store, follows]);
}
export function getFollowing(notes: TaggedRawEvent[], pubkey: HexKey) {

View File

@ -120,7 +120,7 @@ export default function ProfilePage() {
<div className="name">
<h2>
{user?.display_name || user?.name || "Nostrich"}
<FollowsYou followsMe={follows.includes(id)} />
<FollowsYou followsMe={follows.includes(loginPubKey ?? "")} />
</h2>
{user?.nip05 && <Nip05 nip05={user.nip05} pubkey={user.pubkey} />}
<Copy text={npub} />