From: Adam Dullage Date: Tue, 28 Jun 2022 19:27:22 +0000 (+0100) Subject: Add message when deleting note. Resolves #10. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=7fcc5607e5546f6d6aa3ed27e326c08e040afd70;p=flatnotes.git Add message when deleting note. Resolves #10. --- diff --git a/flatnotes/src/components/App.js b/flatnotes/src/components/App.js index fc3eece..96347fb 100644 --- a/flatnotes/src/components/App.js +++ b/flatnotes/src/components/App.js @@ -131,7 +131,7 @@ export default { }, getSearchResults: function() { - var parent = this; + let parent = this; api .get("/api/search", { params: { term: this.searchTerm } }) .then(function(response) { @@ -279,14 +279,19 @@ export default { }, deleteNote: function() { + let parent = this; if ( confirm( `Are you sure you want to delete the note '${this.currentNote.title}'?` ) ) { - api - .delete(`/api/notes/${this.currentNote.filename}`) - .then(this.navigate("/")); + api.delete(`/api/notes/${this.currentNote.filename}`).then(function() { + parent.navigate("/"); + parent.$bvToast.toast("Note Deleted ✓", { + variant: "success", + noCloseButton: true, + }); + }); } },