diff --git a/lib/src/screens/backup/backup_page.dart b/lib/src/screens/backup/backup_page.dart index 59abff990..34ec4a74d 100644 --- a/lib/src/screens/backup/backup_page.dart +++ b/lib/src/screens/backup/backup_page.dart @@ -154,8 +154,12 @@ class BackupPage extends BasePage { leftButtonText: S.of(context).share, actionRightButton: () async { await backupViewModelBase.saveToDownload(backup.name, backup.file); - Navigator.of(dialogContext).pop(); - await showBar(context, S.of(context).file_saved); + if (dialogContext.mounted && Navigator.canPop(dialogContext)) { + Navigator.of(dialogContext).pop(); + } + if (context.mounted && Navigator.canPop(context)) { + await showBar(context, S.of(context).file_saved); + } }, actionLeftButton: () async { Navigator.of(dialogContext).pop(); diff --git a/lib/view_model/hardware_wallet/ledger_view_model.dart b/lib/view_model/hardware_wallet/ledger_view_model.dart index c0746223a..5e77473dd 100644 --- a/lib/view_model/hardware_wallet/ledger_view_model.dart +++ b/lib/view_model/hardware_wallet/ledger_view_model.dart @@ -161,7 +161,7 @@ abstract class LedgerViewModelBase extends HardwareWalletViewModel with Store { allowChangeWallet: true, isReconnect: true, onConnectDevice: (context, ledgerVM) async { - if (context.mounted) { + if (context.mounted && Navigator.of(context).canPop()) { Navigator.of(context).pop(); } },