[gnome-maps] sidebar: Reset error label when changing tranportation mode



commit fbe32bb9479fcd57d43e081e593caa0ffb93afbf
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Apr 1 21:06:11 2020 +0200

    sidebar: Reset error label when changing tranportation mode

 src/sidebar.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index 32946654..ffa409d8 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -243,9 +243,15 @@ var Sidebar = GObject.registerClass({
             loadMoreRow.showNoMore();
         });
 
+        // reset error label when mode changes
+        this._query.connect('notify::transportation', () => {
+            this._errorLabel.label = '';
+        });
+
         this._query.connect('notify', () => {
             if (this._query.isValid()) {
-                this._instructionStack.visible_child = this._instructionSpinner;
+                if (this._errorLabel.label === '')
+                    this._instructionStack.visible_child = this._instructionSpinner;
             } else if (this._instructionStack.visible_child !== this._errorLabel) {
                 if (this._query.transportation === RouteQuery.Transportation.TRANSIT) {
                     this._clearTransitOverview();


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