diff --git a/src/components/NewNote.vue b/src/components/NewNote.vue index 96bc77a..b05a1d0 100644 --- a/src/components/NewNote.vue +++ b/src/components/NewNote.vue @@ -67,6 +67,7 @@ ...mapState(useNotesStore, [ "notes", "currentNotePath", + "createNoteMode", ]), currentNoteDirectory() { @@ -78,12 +79,17 @@ "name-input": true, "error": this.errors.name, } - } + }, + + dialogTitle() { + return this.createNoteMode === "currentBlock" ? "New Note from Block" : "New Note" + }, }, methods: { ...mapActions(useNotesStore, [ "updateNotes", + "createNewNote", "createNewNoteFromActiveBlock", ]), @@ -141,7 +147,14 @@ return } console.log("Creating note", path) - this.createNewNoteFromActiveBlock(path, this.name) + if (this.createNoteMode === "currentBlock") { + this.createNewNoteFromActiveBlock(path, this.name) + } else if (this.createNoteMode === "new") { + this.createNewNote(path, this.name) + } else { + throw new Error("Unknown createNoteMode: " + this.createNoteMode) + } + this.$emit("close") //this.$emit("create", this.$refs.input.value) }, @@ -153,7 +166,7 @@