Skip to content

Commit ee2c60b

Browse files
committed
relax autosave
1 parent 85dbc59 commit ee2c60b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/Note.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export default {
9696
fullscreen: false,
9797
preview: false,
9898
actionsOpen: false,
99+
autosaveTimer: null,
99100
}
100101
},
101102
@@ -224,7 +225,12 @@ export default {
224225
autotitle: routeIsNewNote(this.$route),
225226
}
226227
store.commit('add', note)
227-
setTimeout(saveNote.bind(this, note.id), 1000)
228+
if (this.autosaveTimer === null) {
229+
this.autosaveTimer = setTimeout(() => {
230+
this.autosaveTimer = null
231+
saveNote(note.id)
232+
}, 2000)
233+
}
228234
}
229235
},
230236

0 commit comments

Comments
 (0)