From d470a67cdd1b9bcaaebc87c5ba28203e4295f13a Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Thu, 28 Sep 2023 18:10:00 +0200 Subject: [PATCH] Fix reposts showing up as replies --- src/contexts/SettingsContext.tsx | 2 -- src/stores/note.ts | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/contexts/SettingsContext.tsx b/src/contexts/SettingsContext.tsx index 931bf1a..f6e8667 100644 --- a/src/contexts/SettingsContext.tsx +++ b/src/contexts/SettingsContext.tsx @@ -485,13 +485,11 @@ export const SettingsProvider = (props: { children: ContextChildren }) => { // Add active user's feed if it's missing // @ts-ignore if (initFeeds && !initFeeds.find(f => f.hex === feedLatest.hex)) { - console.log('FIND LATEST') addAvailableFeed(feedLatest, true, true); } // Add active user's feed if it's missing // @ts-ignore if (initFeeds && !initFeeds.find(f => f.hex === feedLatestWithReplies.hex && feedLatestWithReplies.includeReplies)) { - console.log('FIND REPLIES') addAvailableFeed(feedLatestWithReplies, true, true); } diff --git a/src/stores/note.ts b/src/stores/note.ts index 5598339..b69447d 100644 --- a/src/stores/note.ts +++ b/src/stores/note.ts @@ -147,14 +147,16 @@ export const convertToNotes: ConvertToNotes = (page) => { } const mentionIds = Object.keys(mentions) //message.tags.reduce((acc, t) => t[0] === 'e' ? [...acc, t[1]] : acc, []); - const userMentionIds = message.tags.reduce((acc, t) => t[0] === 'p' ? [...acc, t[1]] : acc, []); + const userMentionIds = msg.tags.reduce((acc, t) => t[0] === 'p' ? [...acc, t[1]] : acc, []); + + const repost = message.kind === Kind.Repost ? getRepostInfo(page, msg) : undefined; let replyTo: string[] | undefined; // Determine parent by finding the `e` tag with `reply` then `root` as `marker` // If both fail return the last `e` tag - for (let i=0; i { noteId: nip19.noteEncode(msg.id), noteActions: (page.noteActions && page.noteActions[msg.id]) ?? noActions, }, - repost: message.kind === Kind.Repost ? getRepostInfo(page, message) : undefined, + repost, msg, mentionedNotes, mentionedUsers,