[gnome-maps] transitTweaks: Don't re-try to fetch tweaks after failure



commit abf9dd67d5c28baa1b957760576437e36032e031
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Feb 11 22:03:11 2020 +0100

    transitTweaks: Don't re-try to fetch tweaks after failure

 src/transitTweaks.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/transitTweaks.js b/src/transitTweaks.js
index 578c5179..dc1f7deb 100644
--- a/src/transitTweaks.js
+++ b/src/transitTweaks.js
@@ -54,7 +54,7 @@ var TransitTweaks = class {
     }
 
     _doApplyTweaks(itineraries, callback) {
-        if (this._tweaks !== {}) {
+        if (Object.keys(this._tweaks).length !== 0) {
             itineraries.forEach((itinerary) =>
                 this._applyTweaksToItinerary(itinerary));
         }
@@ -67,6 +67,7 @@ var TransitTweaks = class {
 
         if (!data) {
             Utils.debug('Failed to read from tweak file');
+            this._tweaks = {};
             callback();
         }
 
@@ -85,6 +86,7 @@ var TransitTweaks = class {
         this._session.queue_message(request, (obj, message) => {
             if (message.status_code !== Soup.Status.OK) {
                 Utils.debug('Failed to download tweaks');
+                this._tweaks = {};
                 callback();
             } else {
                 try {


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