diff --git a/frontend/src/components/tasks/partials/Comments.vue b/frontend/src/components/tasks/partials/Comments.vue
index 330e81f3b..15a845ec3 100644
--- a/frontend/src/components/tasks/partials/Comments.vue
+++ b/frontend/src/components/tasks/partials/Comments.vue
@@ -151,7 +151,7 @@
{{ $t('task.comment.comment') }}
@@ -241,7 +241,7 @@ const commentToDelete = reactive(new TaskCommentModel())
const isCommentEdit = ref(false)
const commentEdit = reactive(new TaskCommentModel())
-const newComment = reactive(new TaskCommentModel())
+const newCommentText = ref('')
const saved = ref(null)
const saving = ref(null)
@@ -292,7 +292,6 @@ async function loadComments(taskId: ITask['id']) {
return
}
- newComment.taskId = taskId
commentEdit.taskId = taskId
commentToDelete.taskId = taskId
comments.value = await taskCommentService.getAll({taskId}, {}, currentPage.value)
@@ -317,7 +316,7 @@ const editorActive = ref(true)
const creating = ref(false)
async function addComment() {
- if (newComment.comment === '') {
+ if (newCommentText.value === '') {
return
}
@@ -331,9 +330,12 @@ async function addComment() {
creating.value = true
try {
+ const newComment = new TaskCommentModel()
+ newComment.taskId = props.taskId
+ newComment.comment = newCommentText.value
const comment = await taskCommentService.create(newComment)
comments.value.push(comment)
- newComment.comment = ''
+ newCommentText.value = ''
success({message: t('task.comment.addedSuccess')})
} finally {
creating.value = false