fix: correct location validation and clean up target contact handling

- Fix asymmetric lat/lon validation in _handleContactAdvert (was checking
  longitude != 0 for latitude; now uses (latitude != 0 || longitude != 0)
  for both)
- Remove duplicate targetGuessed assignment in path_trace_map
- Rename public target field to private _targetContact, use local variable
  to avoid unnecessary null-aware operators

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
zjs81
2026-03-14 18:14:39 -07:00
parent 3593cfa843
commit 28a423e0a8
2 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -4757,14 +4757,14 @@ class MeshCoreConnector extends ChangeNotifier {
hasLocation &&
latitude != null &&
latitude.abs() <= 90 &&
longitude != 0
(latitude != 0 || longitude != 0)
? latitude
: existing.latitude,
longitude:
hasLocation &&
longitude != null &&
longitude.abs() <= 180 &&
longitude != 0
(latitude != 0 || longitude != 0)
? longitude
: existing.longitude,
name: hasName ? name : existing.name,