mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-10 10:37:06 +10:00
fix: Improve error handling when restoring last companion public key and update disconnection message in Dutch localization
This commit is contained in:
@@ -973,12 +973,18 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
final lastCompanionPublicKeyHex = prefs.getString(
|
||||
_lastCompanionPublicKeyPref,
|
||||
);
|
||||
if (lastCompanionPublicKeyHex == null ||
|
||||
lastCompanionPublicKeyHex.trim().isEmpty) {
|
||||
return;
|
||||
try {
|
||||
if (lastCompanionPublicKeyHex == null ||
|
||||
lastCompanionPublicKeyHex.trim().isEmpty) {
|
||||
return;
|
||||
}
|
||||
_selfPublicKey = hexToPubKey(lastCompanionPublicKeyHex);
|
||||
_setScopedStorePublicKey(lastCompanionPublicKeyHex);
|
||||
} catch (e) {
|
||||
_appDebugLogService?.error(
|
||||
'Failed to restore last companion scope with public key hex: $lastCompanionPublicKeyHex, error: $e',
|
||||
);
|
||||
}
|
||||
_selfPublicKey = hexToPubKey(lastCompanionPublicKeyHex);
|
||||
_setScopedStorePublicKey(lastCompanionPublicKeyHex);
|
||||
}
|
||||
|
||||
Future<void> loadDiscoveredContactCache() => _loadDiscoveredContactCache();
|
||||
|
||||
Reference in New Issue
Block a user