Ignore pota downloads if we became disabled while requesting data

merge-requests/203/head
Tag 2022-09-21 16:00:02 -07:00
rodzic aa25f41ec3
commit d1ba87803f
1 zmienionych plików z 90 dodań i 81 usunięć

Wyświetl plik

@ -119,6 +119,8 @@ function makeParkFeature(park)
function processPotaParks(buffer) function processPotaParks(buffer)
{ {
if (g_potaEnabled == 1)
{
try try
{ {
let newParks = JSON.parse(buffer); let newParks = JSON.parse(buffer);
@ -145,6 +147,7 @@ function processPotaParks(buffer)
console.log("Failed to load parks!"); console.log("Failed to load parks!");
console.log(e.message); console.log(e.message);
} }
}
} }
function getPotaParks() function getPotaParks()
@ -184,6 +187,8 @@ function uniqueArrayFromArray(input)
function processPotaSpots(buffer) function processPotaSpots(buffer)
{ {
if (g_potaEnabled == 1)
{
try try
{ {
let spots = JSON.parse(buffer); let spots = JSON.parse(buffer);
@ -221,6 +226,7 @@ function processPotaSpots(buffer)
{ {
// can't write, somethings broke // can't write, somethings broke
} }
}
} }
function getPotaSpots() function getPotaSpots()
@ -247,6 +253,8 @@ function getPotaSpots()
function processPotaSchedule(buffer) function processPotaSchedule(buffer)
{ {
if (g_potaEnabled == 1)
{
try try
{ {
let schedules = JSON.parse(buffer); let schedules = JSON.parse(buffer);
@ -294,6 +302,7 @@ function processPotaSchedule(buffer)
{ {
// can't write, somethings broke // can't write, somethings broke
} }
}
} }
function getPotaSchedule() function getPotaSchedule()