Ensure there is always items

This commit is contained in:
nemunaire 2022-12-15 16:29:48 +01:00
commit dcb1779e0a
2 changed files with 10 additions and 2 deletions

View file

@ -8,8 +8,12 @@ export class AlarmSingle {
update({ id, time, routines, comment }) {
this.id = id;
this.time = new Date(time);
this.routines = routines;
this.routines = routines == null ? [] : routines;
this.comment = comment;
if (this.routines.length < 1) {
this.routines.push("");
}
}
async delete() {