@@ -7,6 +7,10 @@ import Vue from 'vue'
77import logger from './logger.js'
88import { getComments } from './services/GetComments.js'
99
10+ import { PiniaVuePlugin , createPinia } from 'pinia'
11+
12+ Vue . use ( PiniaVuePlugin )
13+
1014let ActivityTabPluginView
1115let ActivityTabPluginInstance
1216
@@ -16,16 +20,19 @@ let ActivityTabPluginInstance
1620export function registerCommentsPlugins ( ) {
1721 window . OCA . Activity . registerSidebarAction ( {
1822 mount : async ( el , { context, fileInfo, reload } ) => {
23+ const pinia = createPinia ( )
24+
1925 if ( ! ActivityTabPluginView ) {
2026 const { default : ActivityCommmentAction } = await import ( './views/ActivityCommentAction.vue' )
21- ActivityTabPluginView = Vue . extend ( ActivityCommmentAction )
27+ ActivityTabPluginView = ActivityCommmentAction
2228 }
2329 ActivityTabPluginInstance = new ActivityTabPluginView ( {
2430 parent : context ,
2531 propsData : {
2632 reloadCallback : reload ,
2733 resourceId : fileInfo . id ,
2834 } ,
35+ pinia,
2936 } )
3037 ActivityTabPluginInstance . $mount ( el )
3138 logger . info ( 'Comments plugin mounted in Activity sidebar action' , { fileInfo } )
@@ -42,7 +49,7 @@ export function registerCommentsPlugins() {
4249 const { data : comments } = await getComments ( { resourceType : 'files' , resourceId : fileInfo . id } , { limit, offset } )
4350 logger . debug ( 'Loaded comments' , { fileInfo, comments } )
4451 const { default : CommentView } = await import ( './views/ActivityCommentEntry.vue' )
45- const CommentsViewObject = Vue . extend ( CommentView )
52+ const CommentsViewObject = CommentView
4653
4754 return comments . map ( ( comment ) => ( {
4855 timestamp : moment ( comment . props . creationDateTime ) . toDate ( ) . getTime ( ) ,
0 commit comments