Skip to content

Commit

Permalink
Filter self from social row
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored and futurepaul committed May 8, 2024
1 parent 16d60aa commit 1436335
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/SocialActionRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1436335

Please sign in to comment.