feat: 💨

This commit is contained in:
codytseng
2025-05-24 21:20:49 +08:00
parent ffdc6fd0c8
commit 01462da65f
5 changed files with 75 additions and 42 deletions

View File

@@ -30,14 +30,16 @@ export function ReplyProvider({ children }: { children: React.ReactNode }) {
newReplyIdSet.add(reply.id)
const rootETag = getRootEventTag(reply)
if (!rootETag) return
const rootId = rootETag[1]
newReplyEventMap.set(rootId, [...(newReplyEventMap.get(rootId) || []), reply])
if (rootETag) {
const rootId = rootETag[1]
newReplyEventMap.set(rootId, [...(newReplyEventMap.get(rootId) || []), reply])
}
const parentETag = getParentEventTag(reply)
if (!parentETag) return
const parentId = parentETag[1]
newReplyEventMap.set(parentId, [...(newReplyEventMap.get(parentId) || []), reply])
if (parentETag) {
const parentId = parentETag[1]
newReplyEventMap.set(parentId, [...(newReplyEventMap.get(parentId) || []), reply])
}
})
if (newReplyEventMap.size === 0) return