File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export default {
4949 watch: {
5050 $route (to, from) {
5151 if (to .name !== from .name || to .params .noteId !== from .params .noteId ) {
52+ this .onClose (from .params .noteId )
5253 this .fetchData ()
5354 }
5455 },
@@ -96,7 +97,7 @@ export default {
9697 const title = this .getTitle (markdown)
9798 this .shouldAutotitle = this .isNewNote || (title !== ' ' && title === this .note .title )
9899 }
99- this .onEdit ({ content: markdown, unsaved: unsaved })
100+ this .onEdit ({ content: markdown, unsaved })
100101 }
101102 },
102103 }))
@@ -112,6 +113,14 @@ export default {
112113 })
113114 },
114115
116+ onClose (noteId ) {
117+ const note = store .getters .getNote (parseInt (noteId))
118+ store .commit (' updateNote' , {
119+ ... note,
120+ unsaved: false ,
121+ })
122+ },
123+
115124 fileUpdated ({ fileid }) {
116125 if (this .note .id === fileid) {
117126 this .onEdit ({ unsaved: false })
You can’t perform that action at this time.
0 commit comments