aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/src/services/CommentsInstance.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/src/services/CommentsInstance.js')
-rw-r--r--apps/comments/src/services/CommentsInstance.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/comments/src/services/CommentsInstance.js b/apps/comments/src/services/CommentsInstance.js
index ae6b45a95f2..cc45d0cbea7 100644
--- a/apps/comments/src/services/CommentsInstance.js
+++ b/apps/comments/src/services/CommentsInstance.js
@@ -3,14 +3,16 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { translate as t, translatePlural as n } from '@nextcloud/l10n'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
+import { t, n } from '@nextcloud/l10n'
+import { PiniaVuePlugin, createPinia } from 'pinia'
import Vue from 'vue'
import CommentsApp from '../views/Comments.vue'
import logger from '../logger.js'
+Vue.use(PiniaVuePlugin)
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
// Add translates functions
Vue.mixin({
@@ -34,6 +36,8 @@ export default class CommentInstance {
* @param {object} options the vue options (propsData, parent, el...)
*/
constructor(resourceType = 'files', options = {}) {
+ const pinia = createPinia()
+
// Merge options and set `resourceType` property
options = {
...options,
@@ -41,6 +45,7 @@ export default class CommentInstance {
...(options.propsData ?? {}),
resourceType,
},
+ pinia,
}
// Init Comments component
const View = Vue.extend(CommentsApp)