Skip to content

Commit

Permalink
Potential fix for elastic#621
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Dec 3, 2013
1 parent f194336 commit e832519
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/app/services/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,19 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
// Set the current dashboard
self.current = _.clone(dashboard);

// Ok, now that we've setup the current dashboard, we can inject our services
querySrv = $injector.get('querySrv');
filterSrv = $injector.get('filterSrv');

// Make sure these re-init
querySrv.init();
filterSrv.init();

// If there's an interval set, the indices have not been calculated yet,
// so there is no data. Call refresh to calculate the indices and notify the panels.
self.refresh();
// Delay this until we're sure that querySrv and filterSrv are ready
$timeout(function() {
// Ok, now that we've setup the current dashboard, we can inject our services
querySrv = $injector.get('querySrv');
filterSrv = $injector.get('filterSrv');

// Make sure these re-init
querySrv.init();
filterSrv.init();
},0).then(function() {
// Call refresh to calculate the indices and notify the panels that we're ready to roll
self.refresh();
});

if(dashboard.refresh) {
self.set_interval(dashboard.refresh);
Expand Down

0 comments on commit e832519

Please sign in to comment.