Skip to content

Commit c49a3e4

Browse files
author
Rashid Khan
committed
Tweak for possibe race
1 parent 3f01b71 commit c49a3e4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/app/services/dashboard.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
207207
// Delay this until we're sure that querySrv and filterSrv are ready
208208
$timeout(function() {
209209
// Ok, now that we've setup the current dashboard, we can inject our services
210-
querySrv = $injector.get('querySrv');
211-
filterSrv = $injector.get('filterSrv');
212-
213-
// Make sure these re-init
214-
querySrv.init();
215-
filterSrv.init();
210+
if(!_.isUndefined(self.current.services.query)) {
211+
querySrv = $injector.get('querySrv');
212+
querySrv.init();
213+
}
214+
if(!_.isUndefined(self.current.services.filter)) {
215+
filterSrv = $injector.get('filterSrv');
216+
filterSrv.init();
217+
}
216218
},0).then(function() {
217219
// Call refresh to calculate the indices and notify the panels that we're ready to roll
218220
self.refresh();

0 commit comments

Comments
 (0)