Skip to content

Commit 14bedd0

Browse files
feat: Migrate to files:node:updated
Signed-off-by: Luka Trovic <luka@nextcloud.com>
1 parent 7ee22eb commit 14bedd0

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/components/Editor.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import { getCurrentUser } from '@nextcloud/auth'
7575
import { loadState } from '@nextcloud/initial-state'
7676
import { isPublicShare } from '@nextcloud/sharing/public'
7777
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
78+
import { File } from '@nextcloud/files'
7879
import { Collaboration } from '@tiptap/extension-collaboration'
7980
import Autofocus from '../extensions/Autofocus.js'
8081
import { Doc } from 'yjs'
@@ -114,6 +115,7 @@ import Wrapper from './Editor/Wrapper.vue'
114115
import SkeletonLoading from './SkeletonLoading.vue'
115116
import Assistant from './Assistant.vue'
116117
import Translate from './Modal/Translate.vue'
118+
import { generateRemoteUrl } from '@nextcloud/router'
117119
118120
export default {
119121
name: 'Editor',
@@ -650,7 +652,14 @@ export default {
650652
},
651653
652654
onSave() {
653-
emit('files:file:updated', { fileid: this.fileId })
655+
const user = getCurrentUser()
656+
const node = new File({
657+
id: this.fileId,
658+
source: generateRemoteUrl(`dav/files/${user.uid}${this.relativePath}`),
659+
mtime: new Date(),
660+
mime: 'text/markdown',
661+
})
662+
emit('files:node:updated', node)
654663
this.$nextTick(() => {
655664
this.emit('sync-service:save')
656665
})

0 commit comments

Comments
 (0)