From eeb44045ef28888103f3187e04f54f5be6ce1f8c Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 15 Apr 2026 22:13:46 +0200 Subject: [PATCH] fix: load() logic to not fail when wownero is last open wallet (#3185) --- lib/core/wallet_loading_service.dart | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/core/wallet_loading_service.dart b/lib/core/wallet_loading_service.dart index 029af339a..460381228 100644 --- a/lib/core/wallet_loading_service.dart +++ b/lib/core/wallet_loading_service.dart @@ -72,15 +72,18 @@ class WalletLoadingService { return wallet; } catch (error, stack) { - if (type == WalletType.wownero) rethrow; - await ExceptionHandler.resetLastPopupDate(); - final isLedgerError = await ExceptionHandler.isLedgerError(error); - if (isLedgerError || await requireHardwareWalletConnection(type, name)) rethrow; - await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack)); - + String corruptedWalletsSeeds = "Corrupted wallets seeds (if retrievable, empty otherwise):"; + + if ([WalletType.wownero, WalletType.haven].contains(type)) { + corruptedWalletsSeeds += "\n\n$type $name: $error"; + } else { + await ExceptionHandler.resetLastPopupDate(); + final isLedgerError = await ExceptionHandler.isLedgerError(error); + if (isLedgerError || await requireHardwareWalletConnection(type, name)) rethrow; + await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack)); + } // try fetching the seeds of the corrupted wallet to show it to the user - String corruptedWalletsSeeds = "Corrupted wallets seeds (if retrievable, empty otherwise):"; try { corruptedWalletsSeeds += await _getCorruptedWalletSeeds(name, type); } catch (e) {