From bfdee2a11a8ed424dd3c269deb85e8b3fe92d1be Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 12 Mar 2024 17:01:48 +0100 Subject: [PATCH] fix(Editor): Separate backend readonly flag and editor editable state Use a computed (`isEditableEditor`) to determine if the editor should be in editable state. Signed-off-by: Jonas --- src/components/Editor.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 90436699b9a..95a0044cb54 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -43,7 +43,7 @@ @outline-toggled="outlineToggled"> -
+
{ - this.$editor?.setEditable(false) this.emit('sync-service:error') }) @@ -612,7 +614,7 @@ export default { onStateChange(state) { if (state.initialLoading && !this.contentLoaded) { this.contentLoaded = true - if (this.autofocus && !this.readOnly) { + if (this.autofocus && this.isEditableEditor) { this.$nextTick(() => { this.$editor.commands.autofocus() }) @@ -635,8 +637,6 @@ export default { onIdle() { this.$syncService.close() this.idle = true - this.readOnly = true - this.$editor.setEditable(!this.readOnly) this.$nextTick(() => { this.emit('sync-service:idle')