mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
reorder the promise handlers so that the catch happens last
This commit is contained in:
parent
d5a3aa982c
commit
8e56864356
1 changed files with 5 additions and 7 deletions
|
@ -36,19 +36,17 @@ define(function (require) {
|
|||
resolve: {
|
||||
savedSearch: function (savedSearches, $route, $location, Notifier, courier, indexPatterns) {
|
||||
return savedSearches.get($route.current.params.id)
|
||||
.catch(courier.redirectWhenMissing({
|
||||
'index-pattern': '/settings/indices',
|
||||
'*': '/discover'
|
||||
}))
|
||||
.then(function (savedSearch) {
|
||||
if (!savedSearch) return;
|
||||
|
||||
return indexPatterns.getIds()
|
||||
.then(indexPatterns.ensureSome())
|
||||
.then(function () {
|
||||
return savedSearch;
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(courier.redirectWhenMissing({
|
||||
'index-pattern': '/settings/indices',
|
||||
'*': '/discover'
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue