From 4f4794fa500e5a5c14a2d46cac98d27b1bf1ff54 Mon Sep 17 00:00:00 2001 From: qwqcode Date: Mon, 15 Apr 2024 13:51:51 +0800 Subject: [PATCH] fix(ui/comment): missing reply comment data when inserting --- ui/artalk/src/list/list.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/artalk/src/list/list.ts b/ui/artalk/src/list/list.ts index bb4fb619..a875940b 100644 --- a/ui/artalk/src/list/list.ts +++ b/ui/artalk/src/list/list.ts @@ -65,7 +65,8 @@ export default class List extends Component { // When comment insert this.ctx.on('comment-inserted', (comment) => { - this.getListLayout().insert(comment) + const replyComment = comment.rid ? this.commentNodes.find((c) => c.getID() === comment.rid)?.getData() : undefined + this.getListLayout().insert(comment, replyComment) }) // When comment delete