From 6c9ca8b0253c67c499cf233235a2aad8b72f48ce Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 17 Apr 2024 00:15:46 +0200 Subject: fix(comments): Fix issues thrown by comments sidebar tab code When the comments tab is used instead of the merged activity+comments, then some issues are throws due to prop altering and duplicated names (resourceId as prop and data). This is fixed as well as some other vue related errors in the sidebar Signed-off-by: Ferdinand Thiessen --- apps/comments/src/comments-tab.js | 3 +++ apps/comments/src/views/Comments.vue | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'apps/comments/src') diff --git a/apps/comments/src/comments-tab.js b/apps/comments/src/comments-tab.js index 1a367cc18ee..73038412bd3 100644 --- a/apps/comments/src/comments-tab.js +++ b/apps/comments/src/comments-tab.js @@ -49,6 +49,9 @@ if (loadState('comments', 'activityEnabled', false) && OCA?.Activity?.registerSi TabInstance = new OCA.Comments.View('files', { // Better integration with vue parent component parent: context, + propsData: { + resourceId: fileInfo.id, + }, }) // Only mount after we have all the info we need await TabInstance.update(fileInfo.id) diff --git a/apps/comments/src/views/Comments.vue b/apps/comments/src/views/Comments.vue index 326091723b9..f6fb4387596 100644 --- a/apps/comments/src/views/Comments.vue +++ b/apps/comments/src/views/Comments.vue @@ -31,7 +31,7 @@ :resource-type="resourceType" :editor="true" :user-data="userData" - :resource-id="resourceId" + :resource-id="currentResourceId" class="comments__writer" @new="onNewComment" /> @@ -52,7 +52,7 @@ :auto-complete="autoComplete" :resource-type="resourceType" :message.sync="comment.props.message" - :resource-id="resourceId" + :resource-id="currentResourceId" :user-data="genMentionsData(comment.props.mentions)" class="comments__list" @delete="onDelete" /> @@ -86,7 +86,7 @@