mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-12 20:02:01 +10:00
Merge pull request #339 from ericszimmermann/ez_fix_coordinates
Preserve Coordinates with contact.copyWith() function
This commit is contained in:
@@ -3913,11 +3913,14 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
tag: 'Connector',
|
tag: 'Connector',
|
||||||
);
|
);
|
||||||
|
|
||||||
// CRITICAL: Preserve user's path override when contact is refreshed from device
|
// Preserve user-selected path settings and previously known GPS when
|
||||||
|
// refreshed frames omit coordinates (lat/lon encoded as 0,0).
|
||||||
_contacts[existingIndex] = contact.copyWith(
|
_contacts[existingIndex] = contact.copyWith(
|
||||||
lastMessageAt: mergedLastMessageAt,
|
lastMessageAt: mergedLastMessageAt,
|
||||||
pathOverride: existing.pathOverride, // Preserve user's path choice
|
pathOverride: existing.pathOverride, // Preserve user's path choice
|
||||||
pathOverrideBytes: existing.pathOverrideBytes,
|
pathOverrideBytes: existing.pathOverrideBytes,
|
||||||
|
latitude: contact.latitude ?? existing.latitude,
|
||||||
|
longitude: contact.longitude ?? existing.longitude,
|
||||||
);
|
);
|
||||||
|
|
||||||
appLogger.info(
|
appLogger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user