diff --git a/src/components/Editor.vue b/src/components/Editor.vue index dc633de01f8..1e0ff0c09c4 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -267,7 +267,6 @@ export default { readOnly: true, openReadOnlyEnabled: OCA.Text.OpenReadOnlyEnabled, editMode: true, - forceRecreate: false, menubarLoaded: false, draggedOver: false, @@ -373,7 +372,6 @@ export default { // }); this.$providers = [] this.$editor = null - this.$api = null this.$syncService = null this.$attachmentResolver = null }, @@ -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() @@ -426,7 +423,6 @@ export default { disableBC: true, }) this.$providers.push(syncServiceProvider) - this.forceRecreate = false }, listenEditorEvents() { diff --git a/src/services/SessionApi.js b/src/services/SessionApi.js index 45ff771b69b..acbfcfe8803 100644 --- a/src/services/SessionApi.js +++ b/src/services/SessionApi.js @@ -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)) }