mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-29 00:10:50 +00:00
Fix reposts showing up as replies
This commit is contained in:
parent
d48916917f
commit
d470a67cdd
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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<message.tags.length; i++) {
|
||||
const tag = message.tags[i];
|
||||
for (let i=0; i<msg.tags.length; i++) {
|
||||
const tag = msg.tags[i];
|
||||
|
||||
if (tag[0] !== 'e') continue;
|
||||
|
||||
@ -251,7 +253,7 @@ export const convertToNotes: ConvertToNotes = (page) => {
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user