comments reactive
This commit is contained in:
parent
2c99811caf
commit
82f4aaf904
4 changed files with 19 additions and 66 deletions
|
|
@ -134,12 +134,6 @@ const sortedReplies = ref(null);
|
|||
watch(openedComment, (newVal) => {
|
||||
sortedReplies.value = newVal ? newVal.replies.slice().reverse() : null;
|
||||
});
|
||||
watch(
|
||||
() => comments,
|
||||
(newVal) => {
|
||||
sortedComments.value = newVal.reverse();
|
||||
}
|
||||
);
|
||||
watch(isAddOpen, (newVal) => {
|
||||
if (newVal) {
|
||||
setTimeout(() => {
|
||||
|
|
@ -191,6 +185,7 @@ async function replyComment(newComment) {
|
|||
const newFile = await api.replyComment(newComment);
|
||||
newCommentText.value = "";
|
||||
isAddOpen.value = false;
|
||||
dialog.updateFile(newFile);
|
||||
openedComment.value = newFile.comments.find(
|
||||
(item) => item.id === openedComment.value.id
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue