Skip to content

Commit 4d11c2f

Browse files
committed
fix: Properly indicate save status on switching notes
Signed-off-by: Julius Härtl <[email protected]>
1 parent 83ee3ad commit 4d11c2f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/NoteRich.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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
},
@@ -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 })

0 commit comments

Comments
 (0)