feat: post & reply (#5)

This commit is contained in:
Cody Tseng 2024-11-09 22:28:10 +08:00 committed by GitHub
parent 5b0abcf380
commit 53f9f6240f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 483 additions and 98 deletions

View file

@ -49,7 +49,7 @@ export function NoteStatsProvider({ children }: { children: React.ReactNode }) {
const fetchNoteLikeCount = async (event: Event) => {
const relayList = await client.fetchRelayList(event.pubkey)
const events = await client.fetchEvents(relayList.read, {
const events = await client.fetchEvents(relayList.read.slice(0, 3), {
'#e': [event.id],
kinds: [kinds.Reaction],
limit: 500
@ -74,7 +74,7 @@ export function NoteStatsProvider({ children }: { children: React.ReactNode }) {
const fetchNoteRepostCount = async (event: Event) => {
const relayList = await client.fetchRelayList(event.pubkey)
const events = await client.fetchEvents(relayList.read, {
const events = await client.fetchEvents(relayList.read.slice(0, 3), {
'#e': [event.id],
kinds: [kinds.Repost],
limit: 100
@ -95,7 +95,7 @@ export function NoteStatsProvider({ children }: { children: React.ReactNode }) {
if (!pubkey) return false
const relayList = await client.fetchRelayList(pubkey)
const events = await client.fetchEvents(relayList.write, {
const events = await client.fetchEvents(relayList.write.slice(0, 3), {
'#e': [event.id],
authors: [pubkey],
kinds: [kinds.Reaction]
@ -123,7 +123,7 @@ export function NoteStatsProvider({ children }: { children: React.ReactNode }) {
if (!pubkey) return false
const relayList = await client.fetchRelayList(pubkey)
const events = await client.fetchEvents(relayList.write, {
const events = await client.fetchEvents(relayList.write.slice(0, 3), {
'#e': [event.id],
authors: [pubkey],
kinds: [kinds.Repost]