Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions lib/pages/exchange_view/confirm_change_now_send.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,24 @@ class _ConfirmChangeNowSendViewState
final coin = wallet.info.coin;

final sendProgressController = ProgressAndSuccessController();
var isSendingDialogOpen = false;

void closeSendingDialog() {
if (!context.mounted || !isSendingDialogOpen) {
return;
}
final rootNavigator = Navigator.of(context, rootNavigator: true);
if (rootNavigator.canPop()) {
rootNavigator.pop();
}
isSendingDialogOpen = false;
}

isSendingDialogOpen = true;
unawaited(
showDialog<void>(
context: context,
useRootNavigator: true,
useSafeArea: false,
barrierDismissible: false,
builder: (context) {
Expand All @@ -95,7 +109,7 @@ class _ConfirmChangeNowSendViewState
controller: sendProgressController,
);
},
),
).whenComplete(() => isSendingDialogOpen = false),
);

final time = Future<dynamic>.delayed(const Duration(milliseconds: 2500));
Expand Down Expand Up @@ -141,10 +155,8 @@ class _ConfirmChangeNowSendViewState

// pop back to wallet
if (context.mounted) {
closeSendingDialog();
if (Util.isDesktop) {
// pop sending dialog
Navigator.of(context, rootNavigator: true).pop();

// one day we'll do routing right
Navigator.of(context, rootNavigator: true).pop();
if (widget.fromDesktopStep4) {
Expand All @@ -162,7 +174,7 @@ class _ConfirmChangeNowSendViewState
);

// pop sending dialog
Navigator.of(context).pop();
closeSendingDialog();

await showDialog<dynamic>(
context: context,
Expand Down
6 changes: 5 additions & 1 deletion lib/pages/masternodes/create_masternode_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ class _CreateMasternodeDialogState extends ConsumerState<CreateMasternodeView> {
style: STextStyles.desktopH3(context),
),
),
const DesktopDialogCloseButton(),
DesktopDialogCloseButton(
onPressedOverride: () {
Navigator.of(context, rootNavigator: true).pop();
},
),
],
),
Flexible(
Expand Down
Loading
Loading