fix: Closes #4 修复评论发布时之前的评论被移出列表的问题

This commit is contained in:
2025-09-12 13:12:09 +08:00
parent d893300cac
commit 1a230c85b5

View File

@ -71,7 +71,6 @@ export function CommentSection(
}).then(res => {
toast.success(t("comment_success"));
setTotalCommentCount(c => c + 1);
setComments(prevComments => prevComments.slice(0, -1));
getComment({ id: res.data.id }).then(response => {
console.log("New comment fetched:", response.data);
setComments(prevComments => [response.data, ...prevComments]);