fix: Improve error handling when restoring last companion public key and update disconnection message in Dutch localization

This commit is contained in:
Winston Lowe
2026-05-27 10:26:19 -07:00
parent e1cc285c8a
commit beb3e1996d
3 changed files with 18 additions and 12 deletions
+11 -5
View File
@@ -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();
+1 -1
View File
@@ -1968,7 +1968,7 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get dialog_disconnectedMessage =>
'Je bent verbonden met je companion.';
'Je bent losgekoppeld van je companion.';
@override
String get dialog_connectCompanion =>
+6 -6
View File
@@ -324,12 +324,12 @@ class _ContactsScreenState extends State<ContactsScreen> {
Text(context.l10n.contacts_zeroHopAdvert),
],
),
onTap: () => {
connector.sendSelfAdvert(flood: false),
onTap: () async {
await connector.sendSelfAdvert(flood: false);
showDismissibleSnackBar(
context,
content: Text(context.l10n.settings_advertisementSent),
),
);
},
),
PopupMenuItem(
@@ -340,12 +340,12 @@ class _ContactsScreenState extends State<ContactsScreen> {
Text(context.l10n.contacts_floodAdvert),
],
),
onTap: () => {
connector.sendSelfAdvert(flood: true),
onTap: () async {
await connector.sendSelfAdvert(flood: true);
showDismissibleSnackBar(
context,
content: Text(context.l10n.settings_advertisementSent),
),
);
},
),
PopupMenuItem(