From 23860e0902709d47358f5d9b46ecaa26955449a2 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Thu, 8 Oct 2020 16:55:28 +0200 Subject: [PATCH] fix: allow switching to plain editor when another default editor is set --- app/assets/javascripts/views/editor/editor_view.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/views/editor/editor_view.ts b/app/assets/javascripts/views/editor/editor_view.ts index 061a7cab5..205cd6116 100644 --- a/app/assets/javascripts/views/editor/editor_view.ts +++ b/app/assets/javascripts/views/editor/editor_view.ts @@ -184,7 +184,7 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> { this.registerKeyboardShortcuts(); this.editor.onNoteChange(() => { this.handleEditorNoteChange(); - }) + }); this.editor.onNoteValueChange((note, source) => { if (isPayloadSourceRetrieved(source!)) { this.editorValues.title = note.title; @@ -405,7 +405,8 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> { await this.application.changeItem(this.note.uuid, (mutator) => { const noteMutator = mutator as NoteMutator; noteMutator.prefersPlainEditor = true; - }) + }); + this.reloadEditor(); } if (this.state.editorComponent?.isExplicitlyEnabledForItem(this.note.uuid)) { await this.disassociateComponentWithCurrentNote(this.state.editorComponent);