Skip to content

Commit

Permalink
fix: allow switching to plain editor when another default editor is set
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Oct 8, 2020
1 parent 9fc7de7 commit 23860e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/assets/javascripts/views/editor/editor_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 23860e0

Please sign in to comment.