fix: handle unexpected ViewModel in ledger connection process (#2716)

* fix: handle unexpected ViewModel in ledger connection process

* fix: add missing exception handler for `_QueuedFuture.execute` in `exception_handler.dart`
This commit is contained in:
Konstantin Ullrich
2025-12-12 17:32:07 +02:00
committed by GitHub
parent 2e2a75bef5
commit f122ce0c57
3 changed files with 19 additions and 5 deletions
@@ -61,8 +61,21 @@ void startAuthenticationStateChange(
walletType: WalletType.monero,
hardwareWalletType: HardwareWalletType.ledger,
onConnectDevice: (context, ledgerVM) async {
if (ledgerVM is LedgerViewModel)
if (ledgerVM is LedgerViewModel) {
monero!.setGlobalLedgerConnection(ledgerVM.connection);
} else {
await showPopUp<void>(
context: context,
builder: (context) => AlertWithOneAction(
alertTitle: "Unexpected Error",
alertContent:
"Unexpected Error while trying to connect to the device (UnexpectedViewModel: ${ledgerVM.toString()})",
buttonText: S.of(context).try_again,
buttonAction: Navigator.of(context).pop,
),
);
return;
}
showPopUp<void>(
context: context,
builder: (context) => AlertWithOneAction(