File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export default {
49
49
watch: {
50
50
$route (to, from) {
51
51
if (to .name !== from .name || to .params .noteId !== from .params .noteId ) {
52
+ this .onClose (from .params .noteId )
52
53
this .fetchData ()
53
54
}
54
55
},
@@ -96,7 +97,7 @@ export default {
96
97
const title = this .getTitle (markdown)
97
98
this .shouldAutotitle = this .isNewNote || (title !== ' ' && title === this .note .title )
98
99
}
99
- this .onEdit ({ content: markdown, unsaved: unsaved })
100
+ this .onEdit ({ content: markdown, unsaved })
100
101
}
101
102
},
102
103
}))
@@ -112,6 +113,14 @@ export default {
112
113
})
113
114
},
114
115
116
+ onClose (noteId ) {
117
+ const note = store .getters .getNote (parseInt (noteId))
118
+ store .commit (' updateNote' , {
119
+ ... note,
120
+ unsaved: false ,
121
+ })
122
+ },
123
+
115
124
fileUpdated ({ fileid }) {
116
125
if (this .note .id === fileid) {
117
126
this .onEdit ({ unsaved: false })
You can’t perform that action at this time.
0 commit comments