fix: allow switching to plain editor when another default editor is set
This commit is contained in:
@@ -184,7 +184,7 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
this.registerKeyboardShortcuts();
|
this.registerKeyboardShortcuts();
|
||||||
this.editor.onNoteChange(() => {
|
this.editor.onNoteChange(() => {
|
||||||
this.handleEditorNoteChange();
|
this.handleEditorNoteChange();
|
||||||
})
|
});
|
||||||
this.editor.onNoteValueChange((note, source) => {
|
this.editor.onNoteValueChange((note, source) => {
|
||||||
if (isPayloadSourceRetrieved(source!)) {
|
if (isPayloadSourceRetrieved(source!)) {
|
||||||
this.editorValues.title = note.title;
|
this.editorValues.title = note.title;
|
||||||
@@ -405,7 +405,8 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
await this.application.changeItem(this.note.uuid, (mutator) => {
|
await this.application.changeItem(this.note.uuid, (mutator) => {
|
||||||
const noteMutator = mutator as NoteMutator;
|
const noteMutator = mutator as NoteMutator;
|
||||||
noteMutator.prefersPlainEditor = true;
|
noteMutator.prefersPlainEditor = true;
|
||||||
})
|
});
|
||||||
|
this.reloadEditor();
|
||||||
}
|
}
|
||||||
if (this.state.editorComponent?.isExplicitlyEnabledForItem(this.note.uuid)) {
|
if (this.state.editorComponent?.isExplicitlyEnabledForItem(this.note.uuid)) {
|
||||||
await this.disassociateComponentWithCurrentNote(this.state.editorComponent);
|
await this.disassociateComponentWithCurrentNote(this.state.editorComponent);
|
||||||
|
|||||||
Reference in New Issue
Block a user