diff --git a/apps/comments/src/comments-activity-tab.ts b/apps/comments/src/comments-activity-tab.ts index 765777884f286..f67f702d97bc9 100644 --- a/apps/comments/src/comments-activity-tab.ts +++ b/apps/comments/src/comments-activity-tab.ts @@ -7,6 +7,10 @@ import Vue from 'vue' import logger from './logger.js' import { getComments } from './services/GetComments.js' +import { PiniaVuePlugin, createPinia } from 'pinia' + +Vue.use(PiniaVuePlugin) + let ActivityTabPluginView let ActivityTabPluginInstance @@ -16,9 +20,11 @@ let ActivityTabPluginInstance export function registerCommentsPlugins() { window.OCA.Activity.registerSidebarAction({ mount: async (el, { context, fileInfo, reload }) => { + const pinia = createPinia() + if (!ActivityTabPluginView) { const { default: ActivityCommmentAction } = await import('./views/ActivityCommentAction.vue') - ActivityTabPluginView = Vue.extend(ActivityCommmentAction) + ActivityTabPluginView = ActivityCommmentAction } ActivityTabPluginInstance = new ActivityTabPluginView({ parent: context, @@ -26,6 +32,7 @@ export function registerCommentsPlugins() { reloadCallback: reload, resourceId: fileInfo.id, }, + pinia, }) ActivityTabPluginInstance.$mount(el) logger.info('Comments plugin mounted in Activity sidebar action', { fileInfo }) @@ -42,7 +49,7 @@ export function registerCommentsPlugins() { const { data: comments } = await getComments({ resourceType: 'files', resourceId: fileInfo.id }, { limit, offset }) logger.debug('Loaded comments', { fileInfo, comments }) const { default: CommentView } = await import('./views/ActivityCommentEntry.vue') - const CommentsViewObject = Vue.extend(CommentView) + const CommentsViewObject = CommentView return comments.map((comment) => ({ timestamp: moment(comment.props.creationDateTime).toDate().getTime(), diff --git a/apps/comments/src/components/Comment.vue b/apps/comments/src/components/Comment.vue index 8c6287d9ecba9..29711ad687db0 100644 --- a/apps/comments/src/components/Comment.vue +++ b/apps/comments/src/components/Comment.vue @@ -4,7 +4,7 @@ -->