mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-12 03:27:06 +10:00
Persist Discovered Contacts when updated
This commit is contained in:
@@ -4051,7 +4051,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
Uint8List rawPacket, {
|
Uint8List rawPacket, {
|
||||||
bool noNotify = false,
|
bool noNotify = false,
|
||||||
}) {
|
}) {
|
||||||
debugPrint('Discovered new contact: ${contact.name}');
|
appLogger.info('Discovered new contact: ${contact.name}', tag: 'Connector');
|
||||||
|
|
||||||
final existingIndex = _discoveredContacts.indexWhere(
|
final existingIndex = _discoveredContacts.indexWhere(
|
||||||
(c) => c.publicKeyHex == contact.publicKeyHex,
|
(c) => c.publicKeyHex == contact.publicKeyHex,
|
||||||
@@ -4071,6 +4071,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
lastSeen: contact.lastSeen,
|
lastSeen: contact.lastSeen,
|
||||||
);
|
);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
unawaited(_persistDiscoveredContacts());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user