Preserve comment text on submission errors

This commit is contained in:
Tim
2025-08-06 19:28:57 +08:00
parent b9819252d3
commit fdf51be5f5
3 changed files with 9 additions and 5 deletions

View File

@@ -157,7 +157,7 @@ const CommentItem = {
toast.error('操作失败')
}
}
const submitReply = async (text) => {
const submitReply = async (text, clear) => {
if (!text.trim()) return
isWaitingForReply.value = true
const token = getToken()
@@ -201,6 +201,7 @@ const CommentItem = {
src: data.author.avatar,
iconClick: () => router.push(`/users/${data.author.id}`)
})
clear()
showEditor.value = false
toast.success('回复成功')
} else if (res.status === 429) {