Skip to content

Commit

Permalink
feat: Migrate to files:node:updated
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud committed Sep 18, 2024
1 parent 7ee22eb commit 14bedd0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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')
})
Expand Down

0 comments on commit 14bedd0

Please sign in to comment.