finally dismiss restoration failed dialog

This commit is contained in:
sneurlax 2024-02-20 17:32:02 -06:00
parent 235b731c19
commit 04ca80529a

View file

@ -13,6 +13,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/global/secure_store_provider.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -65,14 +66,22 @@ class _RestoreFailedDialogState extends ConsumerState<RestoreFailedDialog> {
style: STextStyles.itemSubtitle12(context),
),
onPressed: () async {
try {
await ref.read(pWallets).deleteWallet(
ref.read(pWalletInfo(walletId)),
ref.read(secureStoreProvider),
);
} catch (e, s) {
Logging.instance.log(
"Error while getting wallet info in restore failed dialog\n"
"Error: $e\nStack trace: $s",
level: LogLevel.Error,
);
} finally {
if (mounted) {
Navigator.of(context).pop();
}
}
},
),
),