Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ export default {
readOnly: true,
openReadOnlyEnabled: OCA.Text.OpenReadOnlyEnabled,
editMode: true,
forceRecreate: false,
menubarLoaded: false,
draggedOver: false,

Expand Down Expand Up @@ -373,7 +372,6 @@ export default {
// });
this.$providers = []
this.$editor = null
this.$api = null
this.$syncService = null
this.$attachmentResolver = null
},
Expand All @@ -400,20 +398,19 @@ export default {
}
const guestName = localStorage.getItem('nick') ? localStorage.getItem('nick') : ''

this.$api = new SessionApi({
const api = new SessionApi({
guestName,
shareToken: this.shareToken,
filePath: this.relativePath,
forceRecreate: this.forceRecreate,
})

this.$syncService = new SyncService({
api,
baseVersionEtag: this.$baseVersionEtag,
serialize: this.isRichEditor
? (content) => createMarkdownSerializer(this.$editor.schema).serialize(content ?? this.$editor.state.doc)
: (content) => serializePlainText(content ?? this.$editor.state.doc),
getDocumentState: () => getDocumentState(this.$ydoc),
api: this.$api,
})

this.listenSyncServiceEvents()
Expand All @@ -426,7 +423,6 @@ export default {
disableBC: true,
})
this.$providers.push(syncServiceProvider)
this.forceRecreate = false
},

listenEditorEvents() {
Expand Down
1 change: 0 additions & 1 deletion src/services/SessionApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SessionApi {
filePath: this.#options.filePath,
token: this.#options.shareToken,
guestName: this.#options.guestName,
forceRecreate: this.#options.forceRecreate,
}).then(response => new Connection(response, this.#options))
}

Expand Down
Loading