fix: load() logic to not fail when wownero is last open wallet (#3185)

cyan committed Apr 15, 2026 at 22:13 UTC eeb44045ef28888103f3187e04f54f5be6ce1f8c
1 file changed +10 -7
lib/core/wallet_loading_service.dart
+10 -7
@@ -72,15 +72,18 @@ class WalletLoadingService {
72
73 return wallet;
74 } catch (error, stack) {
75 - if (type == WalletType.wownero) rethrow;
76 - await ExceptionHandler.resetLastPopupDate();
77 - final isLedgerError = await ExceptionHandler.isLedgerError(error);
78 - if (isLedgerError || await requireHardwareWalletConnection(type, name)) rethrow;
79 - await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
80 -
75 + String corruptedWalletsSeeds = "Corrupted wallets seeds (if retrievable, empty otherwise):";
76 +
77 + if ([WalletType.wownero, WalletType.haven].contains(type)) {
78 + corruptedWalletsSeeds += "\n\n$type $name: $error";
79 + } else {
80 + await ExceptionHandler.resetLastPopupDate();
81 + final isLedgerError = await ExceptionHandler.isLedgerError(error);
82 + if (isLedgerError || await requireHardwareWalletConnection(type, name)) rethrow;
83 + await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
84 + }
85
86 // try fetching the seeds of the corrupted wallet to show it to the user
83 - String corruptedWalletsSeeds = "Corrupted wallets seeds (if retrievable, empty otherwise):";
87 try {
88 corruptedWalletsSeeds += await _getCorruptedWalletSeeds(name, type);
89 } catch (e) {