fix: 🐛
This commit is contained in:
parent
6c2cd0ff42
commit
30343254bd
2 changed files with 20 additions and 9 deletions
|
|
@ -156,11 +156,18 @@ export default function ReplyNoteList({ index, event }: { index?: number; event:
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if (rootInfo.type === 'A') {
|
} else if (rootInfo.type === 'A') {
|
||||||
filters.push({
|
filters.push(
|
||||||
|
{
|
||||||
|
'#a': [rootInfo.id],
|
||||||
|
kinds: [kinds.ShortTextNote],
|
||||||
|
limit: LIMIT
|
||||||
|
},
|
||||||
|
{
|
||||||
'#A': [rootInfo.id],
|
'#A': [rootInfo.id],
|
||||||
kinds: [ExtendedKind.COMMENT],
|
kinds: [ExtendedKind.COMMENT],
|
||||||
limit: LIMIT
|
limit: LIMIT
|
||||||
})
|
}
|
||||||
|
)
|
||||||
if (rootInfo.relay) {
|
if (rootInfo.relay) {
|
||||||
relayUrls.push(rootInfo.relay)
|
relayUrls.push(rootInfo.relay)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,14 @@ export function isReplyNoteEvent(event: Event) {
|
||||||
if (cache !== undefined) return cache
|
if (cache !== undefined) return cache
|
||||||
|
|
||||||
const mentionsEventIds: string[] = []
|
const mentionsEventIds: string[] = []
|
||||||
for (const [tagName, eventId, , marker] of event.tags) {
|
for (const [tagName, id, , marker] of event.tags) {
|
||||||
if (tagName !== 'e' || !eventId) continue
|
if (tagName === 'a' && id) {
|
||||||
|
EVENT_IS_REPLY_NOTE_CACHE.set(event.id, true)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (tagName !== 'e' || !id) continue
|
||||||
|
|
||||||
mentionsEventIds.push(eventId)
|
mentionsEventIds.push(id)
|
||||||
if (['root', 'reply'].includes(marker)) {
|
if (['root', 'reply'].includes(marker)) {
|
||||||
EVENT_IS_REPLY_NOTE_CACHE.set(event.id, true)
|
EVENT_IS_REPLY_NOTE_CACHE.set(event.id, true)
|
||||||
return true
|
return true
|
||||||
|
|
@ -90,7 +94,7 @@ export function getParentEventTag(event?: Event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getParentAddressableEventTag(event?: Event) {
|
export function getParentAddressableEventTag(event?: Event) {
|
||||||
if (!event || event.kind !== ExtendedKind.COMMENT) return undefined
|
if (!event || ![kinds.ShortTextNote, ExtendedKind.COMMENT].includes(event.kind)) return undefined
|
||||||
|
|
||||||
return event.tags.find(tagNameEquals('a')) ?? event.tags.find(tagNameEquals('A'))
|
return event.tags.find(tagNameEquals('a')) ?? event.tags.find(tagNameEquals('A'))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue