Filter self from social row

This commit is contained in:
benthecarman
2024-05-08 18:41:28 -05:00
committed by Paul Miller
parent 16d60aa115
commit 14363355e2

View File

@@ -16,13 +16,15 @@ export function SocialActionRow(props: {
const getContacts = cache(async () => {
try {
const contacts: TagItem[] = (await sw.get_contacts_sorted()) || [];
const myNpub = (await sw.get_npub()) || "";
// contact must have a npub, ln_address, or lnurl
return contacts.filter(
(contact) =>
contact.npub !== undefined ||
contact.ln_address !== undefined ||
contact.lnurl !== undefined
(contact.npub !== undefined ||
contact.ln_address !== undefined ||
contact.lnurl !== undefined) &&
contact.npub !== myNpub
);
} catch (e) {
console.error(e);