feat: support sending only to current relays
This commit is contained in:
parent
29f5ccc4bb
commit
ccf8c21954
11 changed files with 199 additions and 75 deletions
|
|
@ -6,8 +6,8 @@ import client from '@/services/client.service'
|
|||
import { Heart, Loader } from 'lucide-react'
|
||||
import { Event } from 'nostr-tools'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { formatCount } from './utils'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { formatCount } from './utils'
|
||||
|
||||
export default function LikeButton({
|
||||
event,
|
||||
|
|
@ -56,7 +56,7 @@ export default function LikeButton({
|
|||
|
||||
const targetRelayList = await client.fetchRelayList(event.pubkey)
|
||||
const reaction = createReactionDraftEvent(event)
|
||||
await publish(reaction, targetRelayList.read.slice(0, 3))
|
||||
await publish(reaction, { additionalRelayUrls: targetRelayList.read.slice(0, 3) })
|
||||
markNoteAsLiked(event.id)
|
||||
} catch (error) {
|
||||
console.error('like failed', error)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export default function RepostButton({
|
|||
|
||||
const targetRelayList = await client.fetchRelayList(event.pubkey)
|
||||
const repost = createRepostDraftEvent(event)
|
||||
await publish(repost, targetRelayList.read.slice(0, 5))
|
||||
await publish(repost, { additionalRelayUrls: targetRelayList.read.slice(0, 5) })
|
||||
markNoteAsReposted(event.id)
|
||||
} catch (error) {
|
||||
console.error('repost failed', error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue