Set the timeout prop to null cause clearTimeout won't reset it's value

This commit is contained in:
Alex Tselegidis 2021-01-06 13:47:33 +02:00
parent a78514e22c
commit 610c218cf2

View File

@ -68,6 +68,7 @@ class NotesStore {
// Make sure unsaved changes are persisted before switching to the new note.
if (this.timeout) {
clearTimeout(this.timeout);
this.timeout = null;
await this.save();
this.unlockPage();
}
@ -294,6 +295,7 @@ class NotesStore {
if (this.timeout) {
clearTimeout(this.timeout);
this.timeout = null;
}
this.timeout = setTimeout(() => {
@ -307,6 +309,7 @@ class NotesStore {
if (this.timeout) {
clearTimeout(this.timeout);
this.timeout = null;
}
this.timeout = setTimeout(() => this.list(), 1000);