Skip to content

Commit

Permalink
Only loading the default index pattern when it's required (#25175) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb authored Nov 8, 2018
1 parent 28ef6ae commit 84e1ba3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/public/index_patterns/route_setup/load_default.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export default function (opts) {
const getIds = Private(IndexPatternsGetProvider)('id');
const route = _.get($route, 'current.$$route');

if (!route.requireDefaultIndex) {
return;
}

return getIds()
.then(function (patterns) {
let defaultId = config.get('defaultIndex');
Expand All @@ -80,7 +84,7 @@ export default function (opts) {
defaultId = defined = false;
}

if (!defined && route.requireDefaultIndex) {
if (!defined) {
// If there is only one index pattern, set it as default
if (patterns.length === 1) {
defaultId = patterns[0];
Expand Down

0 comments on commit 84e1ba3

Please sign in to comment.