From 1a5601f755847b7b364ce1d884ef09238bdbebea Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 26 Jun 2025 19:02:05 +0300 Subject: [PATCH] bugfix-unspent-coins-back-button (#2335) * Update unspent_coins_list_page.dart * minor fix * close the page after the update is done --- .../unspent_coins/unspent_coins_list_page.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/src/screens/unspent_coins/unspent_coins_list_page.dart b/lib/src/screens/unspent_coins/unspent_coins_list_page.dart index 965926d63..3c47ea203 100644 --- a/lib/src/screens/unspent_coins/unspent_coins_list_page.dart +++ b/lib/src/screens/unspent_coins/unspent_coins_list_page.dart @@ -41,14 +41,18 @@ class UnspentCoinsListPage extends BasePage { final UnspentCoinsListViewModel unspentCoinsListViewModel; Future handleOnPopInvoked(BuildContext context) async { + final navigator = Navigator.of(context); final hasChanged = unspentCoinsListViewModel.hasAdjustableFieldChanged; if (unspentCoinsListViewModel.items.isEmpty || !hasChanged) { - Navigator.of(context).pop(); - } else { - unspentCoinsListViewModel.setIsDisposing(true); - await unspentCoinsListViewModel.dispose(); - Navigator.of(context).pop(); + if (navigator.canPop()) navigator.pop(); + return; } + + unspentCoinsListViewModel.setIsDisposing(true); + await unspentCoinsListViewModel.dispose(); + + if (navigator.canPop()) navigator.pop(); + if (navigator.canPop()) navigator.pop(); } @override