Browse Source

fix: 🐛

imwald
codytseng 1 year ago
parent
commit
acd8348308
  1. 8
      src/components/NoteStats/LikeButton.tsx
  2. 5
      src/lib/draft-event.ts

8
src/components/NoteStats/LikeButton.tsx

@ -55,13 +55,7 @@ export default function LikeButton({ @@ -55,13 +55,7 @@ export default function LikeButton({
const targetRelayList = await client.fetchRelayList(event.pubkey)
const reaction = createReactionDraftEvent(event)
const isProtected = isProtectedEvent(event)
if (isProtected) {
const seenOn = client.getSeenEventRelayUrls(event.id)
await publish(reaction, { specifiedRelayUrls: seenOn })
} else {
await publish(reaction, { additionalRelayUrls: targetRelayList.read.slice(0, 3) })
}
await publish(reaction, { additionalRelayUrls: targetRelayList.read.slice(0, 4) })
markNoteAsLiked(event.id)
} catch (error) {
console.error('like failed', error)

5
src/lib/draft-event.ts

@ -9,7 +9,6 @@ import { @@ -9,7 +9,6 @@ import {
extractImagesFromContent,
extractMentions,
getEventCoordinate,
isProtectedEvent,
isReplaceable
} from './event'
@ -26,10 +25,6 @@ export function createReactionDraftEvent(event: Event): TDraftEvent { @@ -26,10 +25,6 @@ export function createReactionDraftEvent(event: Event): TDraftEvent {
tags.push(hint ? ['a', getEventCoordinate(event), hint] : ['a', getEventCoordinate(event)])
}
if (isProtectedEvent(event)) {
tags.push(['-'])
}
return {
kind: kinds.Reaction,
content: '+',

Loading…
Cancel
Save