fix: template notes and editors

This commit is contained in:
Mo Bitar
2020-10-08 09:20:51 -05:00
parent 8238387761
commit 0630957ef0
2 changed files with 5 additions and 14 deletions

View File

@@ -347,6 +347,10 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
private async reloadEditor() {
const newEditor = this.application.componentManager!.editorForNote(this.note);
/** Editors cannot interact with template notes so the note must be inserted */
if (newEditor && this.editor.isTemplateNote) {
await this.editor.insertTemplatedNote();
}
const currentEditor = this.state.editorComponent;
if (currentEditor?.uuid !== newEditor?.uuid) {
await this.setState({