From e573edb2a6e7767b222be34ccf52c4b969829450 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 6 Dec 2024 01:32:37 +0100 Subject: [PATCH] Fix so that clicking on "Create new" item in notes selector works #build --- src/components/NoteSelector.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/NoteSelector.vue b/src/components/NoteSelector.vue index de36b5d2..f97e95ee 100644 --- a/src/components/NoteSelector.vue +++ b/src/components/NoteSelector.vue @@ -156,25 +156,27 @@ this.deleteConfirm = false } else if (event.key === "Enter") { event.preventDefault() - if (item.createNew) { - if (this.filteredItems.length === 1) { - this.openCreateNote("new", this.filter) - } else { - this.openCreateNote("new", "") - } - } else if (this.actionButton === 1) { + if (this.actionButton === 1) { //console.log("edit file:", path) this.editNote(item.path) } else if (this.actionButton === 2) { this.deleteConfirmNote(item.path) } else { - this.selectItem(item.path) + this.selectItem(item) } } }, - selectItem(path) { - this.$emit("openNote", path) + selectItem(item) { + if (item.createNew) { + if (this.filteredItems.length === 1) { + this.openCreateNote("new", this.filter) + } else { + this.openCreateNote("new", "") + } + } else { + this.$emit("openNote", item.path) + } }, itemHasActionButtons(item) { @@ -253,7 +255,7 @@