mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-28 06:28:41 +01:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user