From 14bedd0ba459dfc24e554bb1e1e244b559d31da2 Mon Sep 17 00:00:00 2001 From: Luka Trovic Date: Wed, 18 Sep 2024 18:56:45 +0200 Subject: [PATCH] feat: Migrate to files:node:updated Signed-off-by: Luka Trovic --- src/components/Editor.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 60a1df827f4..d7ce6e52dc5 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -75,6 +75,7 @@ import { getCurrentUser } from '@nextcloud/auth' import { loadState } from '@nextcloud/initial-state' import { isPublicShare } from '@nextcloud/sharing/public' import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus' +import { File } from '@nextcloud/files' import { Collaboration } from '@tiptap/extension-collaboration' import Autofocus from '../extensions/Autofocus.js' import { Doc } from 'yjs' @@ -114,6 +115,7 @@ import Wrapper from './Editor/Wrapper.vue' import SkeletonLoading from './SkeletonLoading.vue' import Assistant from './Assistant.vue' import Translate from './Modal/Translate.vue' +import { generateRemoteUrl } from '@nextcloud/router' export default { name: 'Editor', @@ -650,7 +652,14 @@ export default { }, onSave() { - emit('files:file:updated', { fileid: this.fileId }) + const user = getCurrentUser() + const node = new File({ + id: this.fileId, + source: generateRemoteUrl(`dav/files/${user.uid}${this.relativePath}`), + mtime: new Date(), + mime: 'text/markdown', + }) + emit('files:node:updated', node) this.$nextTick(() => { this.emit('sync-service:save') })