fix time regions mutable bug

This commit is contained in:
Marcus Efraimsson 2018-11-15 11:30:49 +01:00
parent 81efc00adf
commit 116e367e71
No known key found for this signature in database
GPG Key ID: EBFE0FB04612DD4A

View File

@ -86,8 +86,10 @@ export class TimeRegionManager {
let i, hRange, timeRegion, regions, fromStart, fromEnd, timeRegionColor;
for (i = 0; i < panel.timeRegions.length; i++) {
timeRegion = panel.timeRegions[i];
const timeRegionsCopy = panel.timeRegions.map(a => ({ ...a }));
for (i = 0; i < timeRegionsCopy.length; i++) {
timeRegion = timeRegionsCopy[i];
if (!(timeRegion.fromDayOfWeek || timeRegion.from) && !(timeRegion.toDayOfWeek || timeRegion.to)) {
continue;