summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@update.uu.se>2020-09-22 22:21:41 +0200
committerMarcus Lundblad <ml@update.uu.se>2020-09-28 22:46:14 +0200
commit64861992de500d4efae4cff4162889a8e3122eb0 (patch)
tree45bc79e7f54b51278fee86bb7db219f48a1e6f2a
parent8fd660a3f4681e1b0193bd0e3775a7f668a0a10c (diff)
downloadgnome-maps-wip/mlundblad/handle-search-http-errors.tar.gz
placeEntry: Show error message on search failurewip/mlundblad/handle-search-http-errors
-rw-r--r--src/placeEntry.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/placeEntry.js b/src/placeEntry.js
index a1c4501a..494784d9 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -258,10 +258,16 @@ var PlaceEntry = GObject.registerClass({
this._cancellable,
(places, error) => {
this._cancellable = null;
- this._updateResults(places);
- // cache results for later
- this._cache[this.text] = places;
+ if (error) {
+ this.place = null;
+ this._popover.showError();
+ } else {
+ this._updateResults(places);
+
+ // cache results for later
+ this._cache[this.text] = places;
+ }
// if search input has been updated, trigger a refresh
if (this.text !== this._previousSearch)