mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-14 04:42:03 +10:00
fix ai suggestions
This commit is contained in:
@@ -171,8 +171,14 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
|
|
||||||
// Compute guessed locations with caching
|
// Compute guessed locations with caching
|
||||||
final maxRangeKm = _estimateLoRaRangeKm(connector);
|
final maxRangeKm = _estimateLoRaRangeKm(connector);
|
||||||
|
final filteredKeys = filteredByKeyPrefix
|
||||||
|
.map((c) => c.publicKeyHex)
|
||||||
|
.join(',');
|
||||||
|
final anchorKeys = allContactsWithLocation
|
||||||
|
.map((c) => c.publicKeyHex)
|
||||||
|
.join(',');
|
||||||
final cacheKey =
|
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) {
|
if (cacheKey != _guessedLocationsCacheKey) {
|
||||||
_guessedLocationsCacheKey = cacheKey;
|
_guessedLocationsCacheKey = cacheKey;
|
||||||
_cachedGuessedLocations = settings.mapShowGuessedLocations
|
_cachedGuessedLocations = settings.mapShowGuessedLocations
|
||||||
|
|||||||
@@ -281,6 +281,7 @@ class PathHistoryService extends ChangeNotifier {
|
|||||||
_autoRotationIndex.remove(contactPubKeyHex);
|
_autoRotationIndex.remove(contactPubKeyHex);
|
||||||
_floodStats.remove(contactPubKeyHex);
|
_floodStats.remove(contactPubKeyHex);
|
||||||
await _storage.clearPathHistory(contactPubKeyHex);
|
await _storage.clearPathHistory(contactPubKeyHex);
|
||||||
|
_version++;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,6 +301,7 @@ class PathHistoryService extends ChangeNotifier {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await _storage.savePathHistory(contactPubKeyHex, _cache[contactPubKeyHex]!);
|
await _storage.savePathHistory(contactPubKeyHex, _cache[contactPubKeyHex]!);
|
||||||
|
_version++;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user