Remove zappers from people list in a thread

This commit is contained in:
Bojan Mojsilovic 2024-04-17 13:22:51 +02:00
parent c7e066121b
commit d06c74f466
3 changed files with 9 additions and 3 deletions

View File

@ -226,7 +226,6 @@ export const ThreadProvider = (props: { children: ContextChildren }) => {
if (content.kind === Kind.EventZapInfo) {
const zapInfo = JSON.parse(content.content) as TopZap;
if (store.topZaps[zapInfo.event_id] === undefined) {
updateStore('topZaps', () => ({ [zapInfo.event_id]: [{ ...zapInfo }]}));
return;

View File

@ -90,7 +90,14 @@ const Thread: Component = () => {
) || [];
};
const people = () => threadContext?.users || [];
const people = () => {
const authors = (threadContext?.notes || []).map(n => n.user);
const mentions = Object.values(primaryNote()?.mentionedUsers || {}).
filter((u) => !authors.find(a => u.pubkey === a.pubkey));
return [ ...authors, ...mentions ];
};
const isFetching = () => threadContext?.isFetching;
createEffect(() => {

View File

@ -218,7 +218,7 @@ export type NostrZapInfo = {
kind: Kind.EventZapInfo,
content: string,
created_at?: number,
tags: string[][],
tags?: string[][],
};
export type NostrEventContent =