Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed May 27, 2020
1 parent 231d95e commit c76681b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export class CreateSourceEditor extends Component {

_onIndexPatternSelect = (indexPatternId) => {
this.setState({ indexPatternId }, () => {
this._previewLayer();
if (!indexPatternId) {
this._previewLayer();
}
this._loadIndexPattern(indexPatternId);
});
};
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c76681b

Please sign in to comment.