diff --git a/client/src/views/Day.vue b/client/src/views/Day.vue
index 1512a4b..65056f7 100644
--- a/client/src/views/Day.vue
+++ b/client/src/views/Day.vue
@@ -151,23 +151,36 @@ export default class Day extends Vue {
}
public async deleteNote() {
- if (!this.day.uuid) {
- return;
- }
-
- try {
- await NoteService.deleteNote(this.day.uuid);
- this.sidebar.getEvents();
- this.sidebar.getSidebarInfo();
- this.$router.push({name: 'Home Redirect'});
- } catch(e) {
- this.$buefy.toast.open({
- duration: 5000,
- message: 'There was an error deleting note. Please try again.',
- position: 'is-top',
- type: 'is-danger'
- });
- }
+ this.$buefy.dialog.confirm({
+ title: 'Deleting Daily Note',
+ message: 'Are you sure you want to delete this daily note? This action cannot be undone!',
+ confirmText: 'Delete',
+ focusOn: 'cancel',
+ type: 'is-danger',
+ hasIcon: true,
+ onConfirm: async () => {
+ if (!this.day.uuid) {
+ return;
+ }
+ try {
+ await NoteService.deleteNote(this.day.uuid);
+ this.sidebar.getEvents();
+ this.sidebar.getSidebarInfo();
+ this.$router.push({name: 'Home Redirect'});
+ } catch(e) {
+ this.$buefy.toast.open({
+ duration: 5000,
+ message: 'There was an error deleting note. Please try again.',
+ position: 'is-top',
+ type: 'is-danger'
+ });
+ }
+ this.$buefy.toast.open({
+ duration: 2000,
+ message: 'Daily note deleted!'
+ });
+ }
+ })
}
public setDefaultText() {
@@ -202,4 +215,4 @@ export default class Day extends Vue {
height: 100vh;
position: relative;
}
-
\ No newline at end of file
+
diff --git a/client/src/views/Note.vue b/client/src/views/Note.vue
index 6005a89..88e1692 100644
--- a/client/src/views/Note.vue
+++ b/client/src/views/Note.vue
@@ -115,22 +115,35 @@ export default class Note extends Vue {
}
public async deleteNote() {
- if (!this.note.uuid) {
- return;
- }
-
- try {
- await NoteService.deleteNote(this.note.uuid);
- this.sidebar.getSidebarInfo();
- this.$router.push({name: 'Home Redirect'});
- } catch(e) {
- this.$buefy.toast.open({
- duration: 5000,
- message: 'There was an error deleting note. Please try again.',
- position: 'is-top',
- type: 'is-danger'
- });
- }
+ this.$buefy.dialog.confirm({
+ title: 'Deleting Note',
+ message: 'Are you sure you want to delete this note? This action cannot be undone!',
+ confirmText: 'Delete',
+ focusOn: 'cancel',
+ type: 'is-danger',
+ hasIcon: true,
+ onConfirm: async () => {
+ if (!this.note.uuid) {
+ return;
+ }
+ try {
+ await NoteService.deleteNote(this.note.uuid);
+ this.sidebar.getSidebarInfo();
+ this.$router.push({name: 'Home Redirect'});
+ } catch(e) {
+ this.$buefy.toast.open({
+ duration: 5000,
+ message: 'There was an error deleting note. Please try again.',
+ position: 'is-top',
+ type: 'is-danger'
+ });
+ }
+ this.$buefy.toast.open({
+ duration: 2000,
+ message: 'Note deleted!'
+ });
+ }
+ })
}
public valChanged(data: string) {
@@ -153,4 +166,4 @@ export default class Note extends Vue {
height: 100vh;
position: relative;
}
-
\ No newline at end of file
+