diff --git a/html/script.js b/html/script.js
index cc3698b..a75d780 100644
--- a/html/script.js
+++ b/html/script.js
@@ -4696,6 +4696,7 @@ function processURLParams(){
}
}
+let regIcaoDownloadRunning = false;
function findPlanes(query, byIcao, byCallsign, byReg, byType) {
if (query == null)
return;
@@ -4708,10 +4709,11 @@ function findPlanes(query, byIcao, byCallsign, byReg, byType) {
selectPlaneByHex(regCache[upper].toLowerCase(), {noDeselect: true, follow: true});
return;
}
- } else {
+ } else if (!regIcaoDownloadRunning) {
+ regIcaoDownloadRunning = true;
let req = jQuery.ajax({ url: databaseFolder + "/regIcao.js",
cache: true,
- timeout: 10000,
+ timeout: 60000,
dataType : 'json',
upper: `${upper}`,
});
@@ -4722,6 +4724,9 @@ function findPlanes(query, byIcao, byCallsign, byReg, byType) {
return;
}
});
+ req.always(function() {
+ regIcaoDownloadRunning = false;
+ });
}
}
for (let i in PlanesOrdered) {