1
0
Fork 0

Corrected test for NaN

master
jeffyactive 2024-08-19 18:00:30 -04:00
parent 431f7570d7
commit 46de0a5ae8
1 changed files with 2 additions and 2 deletions

View File

@ -107,11 +107,11 @@ Bangle.on('GPS', (newGps) => {
mainMenu.HDOP.value = (gps.hdop * 5).toFixed(1) + 'm';
E.showMenu(mainMenu);
if(Number.isFinite(gps.lat) && Number.isFinite(gps.lon)) {
if(!isNaN(gps.lat) && !isNaN(gps.lon)) {
NRF.setAdvertising(encodeGeoLocationElement(), ADVERTISING_OPTIONS);
}
else {
NRF.setAdvertising({}, { name:"Bangle.js" });
NRF.setAdvertising({}, { name: "Bangle.js" });
}
});