feat: 💨
This commit is contained in:
@@ -65,6 +65,9 @@ export default function Likes({ event }: { event: Event }) {
|
||||
)}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
if (pubkey && pubkeys.has(pubkey)) {
|
||||
return
|
||||
}
|
||||
like(key, emoji)
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useScreenSize } from '@/providers/ScreenSizeProvider'
|
||||
import { useUserTrust } from '@/providers/UserTrustProvider'
|
||||
import noteStatsService from '@/services/note-stats.service'
|
||||
import { Loader, PencilLine, Repeat } from 'lucide-react'
|
||||
import { Event, kinds } from 'nostr-tools'
|
||||
import { Event } from 'nostr-tools'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import PostEditor from '../PostEditor'
|
||||
@@ -51,8 +51,8 @@ export default function RepostButton({ event }: { event: Event }) {
|
||||
const hasReposted = noteStats?.repostPubkeySet?.has(pubkey)
|
||||
if (hasReposted) return
|
||||
if (!noteStats?.updatedAt) {
|
||||
const events = await noteStatsService.fetchNoteStats(event, pubkey)
|
||||
if (events.some((e) => e.kind === kinds.Repost && e.pubkey === pubkey)) {
|
||||
const noteStats = await noteStatsService.fetchNoteStats(event, pubkey)
|
||||
if (noteStats.repostPubkeySet?.has(pubkey)) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class NoteStatsService {
|
||||
...(this.noteStatsMap.get(event.id) ?? {}),
|
||||
updatedAt: dayjs().unix()
|
||||
})
|
||||
return events
|
||||
return this.noteStatsMap.get(event.id) ?? {}
|
||||
}
|
||||
|
||||
subscribeNoteStats(noteId: string, callback: () => void) {
|
||||
|
||||
Reference in New Issue
Block a user