Remove notification from phone before checking for similar location

master
RKBoss6 2025-08-01 19:07:23 -04:00 committed by GitHub
parent f35ce929f4
commit a56ff029e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -228,7 +228,8 @@ E.on('notify',msg=>{
lon: d.lon,
location:d.city
}, require("Storage").readJSON("mylocation.json", true) || {});
//remove notification from phone
NRF.ancsAction(msg.uid, false);
if(Math.abs(myLocationJson.lat - locationJson.lat) < 0.0001 && Math.abs(myLocationJson.lon -locationJson.lon) < 0.0001){
//same location, do not write
return;
@ -239,7 +240,7 @@ E.on('notify',msg=>{
myLocationJson.location=locationJson.city;
require("Storage").write("mylocation.json",myLocationJson);
NRF.ancsAction(msg.uid, false);
return;
}