From 2d3f12dc7288f173472533a70ec53b4197ed5c07 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 10 Dec 2023 16:32:43 -0600 Subject: [PATCH] stats: firstE -> firstTaggedId --- src/stats.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stats.ts b/src/stats.ts index e076e14..a0d32d7 100644 --- a/src/stats.ts +++ b/src/stats.ts @@ -26,7 +26,7 @@ async function updateStats(event: Event) { function getStatsDiff(event: Event): StatDiff[] { const statDiffs: StatDiff[] = []; - const firstE = event.tags.find(([name]) => name === 'e')?.[1]; + const firstTaggedId = event.tags.find(([name]) => name === 'e')?.[1]; const inReplyToId = findReplyTag(event as Event<1>)?.[1]; switch (event.kind) { @@ -37,13 +37,13 @@ function getStatsDiff(event: Event): StatDiff[] { } break; case 6: - if (firstE) { - statDiffs.push(['event_stats', firstE, 'reposts_count', 1]); + if (firstTaggedId) { + statDiffs.push(['event_stats', firstTaggedId, 'reposts_count', 1]); } break; case 7: - if (firstE) { - statDiffs.push(['event_stats', firstE, 'reactions_count', 1]); + if (firstTaggedId) { + statDiffs.push(['event_stats', firstTaggedId, 'reactions_count', 1]); } }