[gnome-maps/wip/mlundblad/handle-search-http-errors: 3/3] placeEntry: Show error message on search failure




commit e37dedfa5a70f78ef23214df64024836656fa712
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Sep 22 22:21:41 2020 +0200

    placeEntry: Show error message on search failure

 src/placeEntry.js | 12 +++++++++---
 1 file 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]