Check if a user has moved 9 meters for the position log instead of 15 in case they have set the value to 10 meters

This commit is contained in:
Garth Vander Houwen 2025-06-27 15:56:03 -07:00
parent 365699d1d4
commit 5c08f81550
2 changed files with 2 additions and 2 deletions

View file

@ -454,7 +454,7 @@ func upsertPositionPacket (packet: MeshPacket, context: NSManagedObjectContext)
}
/// Don't save nearly the same position over and over. If the next position is less than 10 meters from the new position, delete the previous position and save the new one.
if mutablePositions.count > 0 && (position.precisionBits == 32 || position.precisionBits == 0) {
if let mostRecent = mutablePositions.lastObject as? PositionEntity, mostRecent.coordinate.distance(from: position.coordinate) < 15.0 {
if let mostRecent = mutablePositions.lastObject as? PositionEntity, mostRecent.coordinate.distance(from: position.coordinate) < 9.0 {
mutablePositions.remove(mostRecent)
}
} else if mutablePositions.count > 0 {

@ -1 +1 @@
Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705
Subproject commit 27fac39141d99fe727a0a1824c5397409b1aea75