Remove accidental empty query

This commit is contained in:
Pieter Vander Vennet 2020-09-17 14:24:28 +02:00
parent 2dd428497e
commit 82e5a80c0d

View file

@ -44,11 +44,15 @@ export class SearchAndGo extends UIElement {
// Triggered by 'enter' or onclick // Triggered by 'enter' or onclick
private RunSearch() { private RunSearch() {
const searchString = this._searchField.GetValue().data; const searchString = this._searchField.GetValue().data;
if(searchString === undefined || searchString === ""){
return;
}
this._searchField.GetValue().setData(""); this._searchField.GetValue().setData("");
this._placeholder.setData(Translations.t.general.search.searching); this._placeholder.setData(Translations.t.general.search.searching);
const self = this; const self = this;
Geocoding.Search(searchString, (result) => { Geocoding.Search(searchString, (result) => {
console.log("Search result", result)
if (result.length == 0) { if (result.length == 0) {
self._placeholder.setData(Translations.t.general.search.nothing); self._placeholder.setData(Translations.t.general.search.nothing);
return; return;