bugfix-unspent-coins-back-button (#2335)

* Update unspent_coins_list_page.dart

* minor fix

* close the page after the update is done
This commit is contained in:
Serhii 2025-06-26 19:02:05 +03:00 committed by GitHub
parent 04c86c567f
commit 1a5601f755
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,14 +41,18 @@ class UnspentCoinsListPage extends BasePage {
final UnspentCoinsListViewModel unspentCoinsListViewModel; final UnspentCoinsListViewModel unspentCoinsListViewModel;
Future<void> handleOnPopInvoked(BuildContext context) async { Future<void> handleOnPopInvoked(BuildContext context) async {
final navigator = Navigator.of(context);
final hasChanged = unspentCoinsListViewModel.hasAdjustableFieldChanged; final hasChanged = unspentCoinsListViewModel.hasAdjustableFieldChanged;
if (unspentCoinsListViewModel.items.isEmpty || !hasChanged) { if (unspentCoinsListViewModel.items.isEmpty || !hasChanged) {
Navigator.of(context).pop(); if (navigator.canPop()) navigator.pop();
} else { return;
unspentCoinsListViewModel.setIsDisposing(true);
await unspentCoinsListViewModel.dispose();
Navigator.of(context).pop();
} }
unspentCoinsListViewModel.setIsDisposing(true);
await unspentCoinsListViewModel.dispose();
if (navigator.canPop()) navigator.pop();
if (navigator.canPop()) navigator.pop();
} }
@override @override