From 1443cc400046365cd7d54e9b2e91281128158fd4 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 19 Aug 2024 18:22:03 -0400 Subject: [PATCH] Removed remaining invalid references to Number.isFinite() --- apps/openlocatebeacon/ChangeLog | 1 + apps/openlocatebeacon/metadata.json | 2 +- apps/openlocatebeacon/openlocatebeacon.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openlocatebeacon/ChangeLog b/apps/openlocatebeacon/ChangeLog index 3b392b46b..2a9236565 100644 --- a/apps/openlocatebeacon/ChangeLog +++ b/apps/openlocatebeacon/ChangeLog @@ -1,2 +1,3 @@ 0.01: New App! 0.02: Corrected NaN test for GPS +0.03: Removed remaining invalid references to Number.isFinite diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json index 98a8a008f..d46624b8b 100644 --- a/apps/openlocatebeacon/metadata.json +++ b/apps/openlocatebeacon/metadata.json @@ -2,7 +2,7 @@ "id": "openlocatebeacon", "name": "OpenLocate Beacon", "shortName": "OpenLocate Beacon", - "version": "0.02", + "version": "0.03", "description": "Advertise GPS geolocation date using the OpenLocate Beacon packet specification.", "icon": "openlocatebeacon.png", "screenshots": [], diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js index b4f7ba5db..b240e6f6f 100644 --- a/apps/openlocatebeacon/openlocatebeacon.js +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -42,7 +42,7 @@ function encodeGeoLocationElement() { lci[7] = (rfc6225lon.fraction >> 16) & 0xff; lci[8] = (rfc6225lon.fraction >> 8) & 0xff; lci[9] = rfc6225lon.fraction & 0xff; - lci[10] = Number.isFinite(bar.altitude) ? 0x10 : 0x00; + lci[10] = bar.altitude ? 0x10 : 0x00; lci[11] = (rfc6225alt.integer >> 16) & 0xff; lci[12] = (rfc6225alt.integer >> 8) & 0xff; lci[13] = rfc6225alt.integer & 0xff; @@ -73,7 +73,7 @@ function toRfc6225Coordinate(coordinate) { // Convert altitude to RFC6225 function toRfc6225Altitude(altitude) { - if(!Number.isFinite(altitude)) { + if(!altitude) { return { integer: 0, fraction: 0 }; }