fix(templating): fixed duplicate dashboard refresh when changing template variable, #7654

This commit is contained in:
Torkel Ödegaard 2017-02-24 08:16:37 +01:00
parent 46ac8c098f
commit e73b306e0c

View File

@ -96,11 +96,15 @@ class TimeSrv {
this.initTimeFromUrl();
this.setTime(this.time, true);
}
} else {
} else if (this.timeHasChangedSinceLoad()) {
this.setTime(this.timeAtLoad, true);
}
}
private timeHasChangedSinceLoad() {
return this.timeAtLoad.from !== this.time.from || this.timeAtLoad.to !== this.time.to;
}
setAutoRefresh(interval) {
this.dashboard.refresh = interval;
if (interval) {