Skip to content
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
12 changes: 12 additions & 0 deletions lib/pages/masternodes/masternode_constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
abstract final class MasternodeCollateralNotes {
MasternodeCollateralNotes._();

static const unshield =
"Masternode collateral unshield (1000 FIRO to transparent).";
static const prep = "Masternode collateral prep (1000 FIRO self-send).";

static bool isUnshield(String? note) =>
note != null && note.contains(unshield);

static bool isPrep(String? note) => note != null && note.contains(prep);
}
Loading
Loading