diff --git a/ui/src/lib/alarmrepeated.js b/ui/src/lib/alarmrepeated.js index baef914..27002fe 100644 --- a/ui/src/lib/alarmrepeated.js +++ b/ui/src/lib/alarmrepeated.js @@ -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() { diff --git a/ui/src/lib/alarmsingle.js b/ui/src/lib/alarmsingle.js index f8e5927..8a171b3 100644 --- a/ui/src/lib/alarmsingle.js +++ b/ui/src/lib/alarmsingle.js @@ -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() {