]> git.openstreetmap.org Git - rails.git/commitdiff
Keep reference to AbortController on AbortError in data layer
authorAnton Khorev <tony29@yandex.ru>
Sat, 5 Apr 2025 16:13:11 +0000 (19:13 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sat, 5 Apr 2025 16:13:11 +0000 (19:13 +0300)
app/assets/javascripts/index/layers/data.js

index 6452c2a4163d2938a349e44e2b781c7b282e03c4..03c774f041da010d0df1ebff91c74f63e32c87f6 100644 (file)
@@ -132,6 +132,8 @@ OSM.initializeDataLayer = function (map) {
         if (map._objectLayer) {
           map._objectLayer.bringToFront();
         }
         if (map._objectLayer) {
           map._objectLayer.bringToFront();
         }
+
+        dataLoader = null;
       })
       .catch(function (error) {
         if (error.name === "AbortError") return;
       })
       .catch(function (error) {
         if (error.name === "AbortError") return;
@@ -139,9 +141,10 @@ OSM.initializeDataLayer = function (map) {
         displayLoadError(error?.message, () => {
           $("#browse_status").empty();
         });
         displayLoadError(error?.message, () => {
           $("#browse_status").empty();
         });
+
+        dataLoader = null;
       })
       .finally(() => {
       })
       .finally(() => {
-        dataLoader = null;
         spanLoading.remove();
       });
   }
         spanLoading.remove();
       });
   }