fix: delete all

eventlist in timer object was not reset correctly
This commit is contained in:
cv
2021-06-14 14:50:04 +02:00
parent a5596eecec
commit 4d7a26a66d
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -480,6 +480,15 @@ export class EventTimer extends Timer {
});
}
clearEventList() {
// unload events
this.unload();
// set general
this._eventlist = [];
this.numEvents = 0;
}
setupWithEventList(eventlist) {
if (!Array.isArray(eventlist) || eventlist.length < 1) return;
+1 -1
View File
@@ -320,7 +320,7 @@ export const eventsDeleteAll = async (req, res) => {
db.write();
// update timer object
_updateTimersSingle();
global.timer.clearEventList();
res.sendStatus(201);
} catch (error) {