fix: cancel the initial timer when changing the auto-refresh interval, fixes #9139 (#9140)

This commit is contained in:
Jesse White 2017-09-01 01:19:51 -04:00 committed by Torkel Ödegaard
parent e763104a6f
commit 91fb3f2224

View File

@ -116,16 +116,14 @@ class TimeSrv {
setAutoRefresh(interval) {
this.dashboard.refresh = interval;
this.cancelNextRefresh();
if (interval) {
var intervalMs = kbn.interval_to_ms(interval);
this.$timeout(() => {
this.refreshTimer = this.timer.register(this.$timeout(() => {
this.startNextRefreshTimer(intervalMs);
this.refreshDashboard();
}, intervalMs);
} else {
this.cancelNextRefresh();
}, intervalMs));
}
// update url