Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrate to files:node:updated #6427

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text app might also handle other mime types, so we should take the one that the viewer passes along to us

})
emit('files:node:updated', node)
this.$nextTick(() => {
this.emit('sync-service:save')
})
Expand Down
Loading