From c76681becf18f7a7a9d13dcd2d217f611ac4a582 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 27 May 2020 13:59:22 -0600 Subject: [PATCH] cleanup --- .../sources/es_search_source/create_source_editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/create_source_editor.js b/x-pack/plugins/maps/public/classes/sources/es_search_source/create_source_editor.js index e23c9813a11b5e..adedde2761f2ec 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/create_source_editor.js @@ -65,7 +65,9 @@ export class CreateSourceEditor extends Component { _onIndexPatternSelect = (indexPatternId) => { this.setState({ indexPatternId }, () => { - this._previewLayer(); + if (!indexPatternId) { + this._previewLayer(); + } this._loadIndexPattern(indexPatternId); }); }; @@ -110,7 +112,7 @@ export class CreateSourceEditor extends Component { geoFields, }); - if (geoFields.length && !this.state.geoFieldName) { + if (geoFields.length) { // make default selection, prefer aggregatable field over the first available const firstAggregatableGeoField = geoFields.find((geoField) => { return geoField.aggregatable;