Ensure there is always items
This commit is contained in:
parent
41a8d1e3e2
commit
dcb1779e0a
@ -9,11 +9,15 @@ export class AlarmRepeated {
|
||||
this.id = id;
|
||||
this.weekday = weekday;
|
||||
this.time = time;
|
||||
this.routines = routines;
|
||||
this.routines = routines == null ? [] : routines;
|
||||
this.ignore_exceptions = ignore_exceptions;
|
||||
this.comment = comment;
|
||||
this.excepts = excepts;
|
||||
this.next_time = next_time;
|
||||
|
||||
if (this.routines.length < 1) {
|
||||
this.routines.push("");
|
||||
}
|
||||
}
|
||||
|
||||
async delete() {
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user