Skip to content

Commit

Permalink
fix time regions mutable bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marefr committed Nov 15, 2018
1 parent 81efc00 commit 116e367
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/app/plugins/panel/graph/time_region_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 116e367

Please sign in to comment.