From f35ce929f465bb22d99c62dc56216df2861d813a Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Fri, 1 Aug 2025 16:09:59 -0400 Subject: [PATCH] Add check preventing same location being written to flash twice --- apps/ios/boot.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 0073aa43a..01db5e85c 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -124,6 +124,7 @@ E.on('notify',msg=>{ "tv.twitch": "Twitch", // could also use NRF.ancsGetAppInfo(msg.appId) here }; + //if (appNames[msg.appId]) msg.a if (msg.title === "BangleDumpCalendar") { @@ -227,6 +228,12 @@ E.on('notify',msg=>{ lon: d.lon, location:d.city }, require("Storage").readJSON("mylocation.json", true) || {}); + + if(Math.abs(myLocationJson.lat - locationJson.lat) < 0.0001 && Math.abs(myLocationJson.lon -locationJson.lon) < 0.0001){ + //same location, do not write + return; + } + myLocationJson.lon=locationJson.lon; myLocationJson.lat=locationJson.lat; myLocationJson.location=locationJson.city;