Commit 99556057 by Torkel Ödegaard

Fixed bug with auto refresh option being reset when changing relative time when…

Fixed bug with auto refresh option being reset when changing relative time when now delay is configured, Fixes #2042
parent 921d672a
...@@ -93,7 +93,7 @@ define([ ...@@ -93,7 +93,7 @@ define([
_.extend(this.time, time); _.extend(this.time, time);
// disable refresh if we have an absolute time // disable refresh if we have an absolute time
if (time.to !== 'now') { if (time.to && time.to.indexOf('now') === -1) {
this.old_refresh = this.dashboard.refresh || this.old_refresh; this.old_refresh = this.dashboard.refresh || this.old_refresh;
this.set_interval(false); this.set_interval(false);
} }
......
...@@ -90,6 +90,12 @@ define([ ...@@ -90,6 +90,12 @@ define([
ctx.service.setTime({from: '2011-01-01', to: 'now' }); ctx.service.setTime({from: '2011-01-01', to: 'now' });
expect(_dashboard.refresh).to.be('10s'); expect(_dashboard.refresh).to.be('10s');
}); });
it('should keep refresh after relative time range is changed and now delay exists', function() {
_dashboard.refresh = '10s';
ctx.service.setTime({from: 'now-1h', to: 'now-10s' });
expect(_dashboard.refresh).to.be('10s');
});
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment