fix: assign active tag when creating a new note

This commit is contained in:
Baptiste Grob
2020-11-16 17:00:01 +01:00
parent 0f84a6cbad
commit d49d2e996b
3 changed files with 34 additions and 11 deletions

View File

@@ -152,10 +152,20 @@ export class AppState {
*/
async createEditor(title?: string) {
const activeEditor = this.getActiveEditor();
const activeTagUuid = this.selectedTag
? this.selectedTag.isSmartTag()
? undefined
: this.selectedTag.uuid
: undefined;
if (!activeEditor || this.multiEditorEnabled) {
this.application.editorGroup.createEditor(undefined, title);
this.application.editorGroup.createEditor(
undefined,
title,
activeTagUuid
);
} else {
await activeEditor.reset(title);
await activeEditor.reset(title, activeTagUuid);
}
}