From b2770ef028ec25190bfaf23efaacd7cd0544f312 Mon Sep 17 00:00:00 2001 From: zach Date: Fri, 6 Mar 2026 15:11:21 -0700 Subject: [PATCH] fix ai suggestions --- lib/screens/map_screen.dart | 8 +++++++- lib/services/path_history_service.dart | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/screens/map_screen.dart b/lib/screens/map_screen.dart index 79ce54a..0956b96 100644 --- a/lib/screens/map_screen.dart +++ b/lib/screens/map_screen.dart @@ -171,8 +171,14 @@ class _MapScreenState extends State { // Compute guessed locations with caching final maxRangeKm = _estimateLoRaRangeKm(connector); + final filteredKeys = filteredByKeyPrefix + .map((c) => c.publicKeyHex) + .join(','); + final anchorKeys = allContactsWithLocation + .map((c) => c.publicKeyHex) + .join(','); final cacheKey = - '${filteredByKeyPrefix.length}:${allContactsWithLocation.length}:${pathHistory.version}:${connector.currentSf}:${connector.currentBwHz}:${connector.currentTxPower}:${settings.mapShowGuessedLocations}'; + '$filteredKeys|$anchorKeys|${pathHistory.version}:${connector.currentSf}:${connector.currentBwHz}:${connector.currentTxPower}:${settings.mapShowGuessedLocations}'; if (cacheKey != _guessedLocationsCacheKey) { _guessedLocationsCacheKey = cacheKey; _cachedGuessedLocations = settings.mapShowGuessedLocations diff --git a/lib/services/path_history_service.dart b/lib/services/path_history_service.dart index 3da87cc..569fada 100644 --- a/lib/services/path_history_service.dart +++ b/lib/services/path_history_service.dart @@ -281,6 +281,7 @@ class PathHistoryService extends ChangeNotifier { _autoRotationIndex.remove(contactPubKeyHex); _floodStats.remove(contactPubKeyHex); await _storage.clearPathHistory(contactPubKeyHex); + _version++; notifyListeners(); } @@ -300,6 +301,7 @@ class PathHistoryService extends ChangeNotifier { ); await _storage.savePathHistory(contactPubKeyHex, _cache[contactPubKeyHex]!); + _version++; notifyListeners(); }