diff --git a/src/subscriptions.ts b/src/subscriptions.ts index 2a5b8ae..d8d6e6d 100644 --- a/src/subscriptions.ts +++ b/src/subscriptions.ts @@ -148,6 +148,7 @@ export const subProfile = ( pubkey: string, onEvent: SubCallback, ) => { + console.info(`subscribe to profile ${pubkey}`); unsubAll(); sub({ cb: onEvent, @@ -155,13 +156,17 @@ export const subProfile = ( authors: [pubkey], kinds: [0], limit: 1, - } + }, }); + + const repliesTo = new Set(); // get notes for profile sub({ cb: (evt, relay) => { - const repliesTo = new Set(); - if (evt.tags.some(hasEventTag) && !evt.tags.some(isMention)) { + if ( + evt.tags.some(hasEventTag) + && !evt.tags.some(isMention) + ) { const note = getReplyTo(evt); if (note && !repliesTo.has(note)) { repliesTo.add(note); @@ -173,7 +178,7 @@ export const subProfile = ( kinds: [1], limit: 1, } - }) + }); } } onEvent(evt, relay);