From edabdedced3f1fb21cfd7206472345e90da5056d Mon Sep 17 00:00:00 2001 From: kPherox Date: Thu, 16 Feb 2023 17:49:03 +0900 Subject: [PATCH] feat: add tracking id for kind1 reposts --- packages/app/src/Feed/TimelineFeed.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/app/src/Feed/TimelineFeed.ts b/packages/app/src/Feed/TimelineFeed.ts index a52f5b47..ebde5081 100644 --- a/packages/app/src/Feed/TimelineFeed.ts +++ b/packages/app/src/Feed/TimelineFeed.ts @@ -147,11 +147,21 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel } return s; }); - const reposts = main.store.notes + const repostsByKind6 = main.store.notes .filter(a => a.kind === EventKind.Repost && a.content === "") .map(a => a.tags.find(b => b[0] === "e")) .filter(a => a) .map(a => unwrap(a)[1]); + const repostsByKind1 = main.store.notes + .filter( + a => + (a.kind === EventKind.Repost || a.kind === EventKind.TextNote) && + a.tags.some(b => b[0] === "e" && b[3] === "mention") + ) + .map(a => a.tags.find((b, i) => b[0] === "e" && b[3] === "mention" && a.content === `#[${i}]`)) + .filter(a => a) + .map(a => unwrap(a)[1]); + const reposts = [...repostsByKind6, ...repostsByKind1]; if (reposts.length > 0) { setTrackingParentEvents(s => { if (reposts.some(a => !s.includes(a))) {