stats: handleEvent7 use findLast

This commit is contained in:
Alex Gleason 2024-06-06 12:11:15 -05:00
parent 3115c8d362
commit 4361c340b0
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ async function handleEvent6(kysely: Kysely<DittoTables>, event: NostrEvent, x: n
/** Update stats for kind 7 event. */ /** Update stats for kind 7 event. */
async function handleEvent7(kysely: Kysely<DittoTables>, event: NostrEvent, x: number): Promise<void> { async function handleEvent7(kysely: Kysely<DittoTables>, event: NostrEvent, x: number): Promise<void> {
const id = event.tags.find(([name]) => name === 'e')?.[1]; const id = event.tags.findLast(([name]) => name === 'e')?.[1];
const emoji = event.content; const emoji = event.content;
if (id && emoji && (['+', '-'].includes(emoji) || /^\p{RGI_Emoji}$/v.test(emoji))) { if (id && emoji && (['+', '-'].includes(emoji) || /^\p{RGI_Emoji}$/v.test(emoji))) {