fix: 🐛
This commit is contained in:
parent
d322f595fe
commit
acd8348308
2 changed files with 1 additions and 12 deletions
|
|
@ -55,13 +55,7 @@ export default function LikeButton({
|
||||||
|
|
||||||
const targetRelayList = await client.fetchRelayList(event.pubkey)
|
const targetRelayList = await client.fetchRelayList(event.pubkey)
|
||||||
const reaction = createReactionDraftEvent(event)
|
const reaction = createReactionDraftEvent(event)
|
||||||
const isProtected = isProtectedEvent(event)
|
await publish(reaction, { additionalRelayUrls: targetRelayList.read.slice(0, 4) })
|
||||||
if (isProtected) {
|
|
||||||
const seenOn = client.getSeenEventRelayUrls(event.id)
|
|
||||||
await publish(reaction, { specifiedRelayUrls: seenOn })
|
|
||||||
} else {
|
|
||||||
await publish(reaction, { additionalRelayUrls: targetRelayList.read.slice(0, 3) })
|
|
||||||
}
|
|
||||||
markNoteAsLiked(event.id)
|
markNoteAsLiked(event.id)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('like failed', error)
|
console.error('like failed', error)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import {
|
||||||
extractImagesFromContent,
|
extractImagesFromContent,
|
||||||
extractMentions,
|
extractMentions,
|
||||||
getEventCoordinate,
|
getEventCoordinate,
|
||||||
isProtectedEvent,
|
|
||||||
isReplaceable
|
isReplaceable
|
||||||
} from './event'
|
} from './event'
|
||||||
|
|
||||||
|
|
@ -26,10 +25,6 @@ export function createReactionDraftEvent(event: Event): TDraftEvent {
|
||||||
tags.push(hint ? ['a', getEventCoordinate(event), hint] : ['a', getEventCoordinate(event)])
|
tags.push(hint ? ['a', getEventCoordinate(event), hint] : ['a', getEventCoordinate(event)])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isProtectedEvent(event)) {
|
|
||||||
tags.push(['-'])
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
kind: kinds.Reaction,
|
kind: kinds.Reaction,
|
||||||
content: '+',
|
content: '+',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue