Skip to content

Commit 54631d5

Browse files
committed
Merge remote-tracking branch 'origin/staging' into julian/testing
2 parents aae436b + f1565a3 commit 54631d5

16 files changed

Lines changed: 1318 additions & 362 deletions

File tree

lib/pages/exchange_view/confirm_change_now_send.dart

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,24 @@ class _ConfirmChangeNowSendViewState
8383
final coin = wallet.info.coin;
8484

8585
final sendProgressController = ProgressAndSuccessController();
86+
var isSendingDialogOpen = false;
8687

88+
void closeSendingDialog() {
89+
if (!context.mounted || !isSendingDialogOpen) {
90+
return;
91+
}
92+
final rootNavigator = Navigator.of(context, rootNavigator: true);
93+
if (rootNavigator.canPop()) {
94+
rootNavigator.pop();
95+
}
96+
isSendingDialogOpen = false;
97+
}
98+
99+
isSendingDialogOpen = true;
87100
unawaited(
88101
showDialog<void>(
89102
context: context,
103+
useRootNavigator: true,
90104
useSafeArea: false,
91105
barrierDismissible: false,
92106
builder: (context) {
@@ -95,7 +109,7 @@ class _ConfirmChangeNowSendViewState
95109
controller: sendProgressController,
96110
);
97111
},
98-
),
112+
).whenComplete(() => isSendingDialogOpen = false),
99113
);
100114

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

142156
// pop back to wallet
143157
if (context.mounted) {
158+
closeSendingDialog();
144159
if (Util.isDesktop) {
145-
// pop sending dialog
146-
Navigator.of(context, rootNavigator: true).pop();
147-
148160
// one day we'll do routing right
149161
Navigator.of(context, rootNavigator: true).pop();
150162
if (widget.fromDesktopStep4) {
@@ -162,7 +174,7 @@ class _ConfirmChangeNowSendViewState
162174
);
163175

164176
// pop sending dialog
165-
Navigator.of(context).pop();
177+
closeSendingDialog();
166178

167179
await showDialog<dynamic>(
168180
context: context,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
abstract final class MasternodeCollateralNotes {
2+
MasternodeCollateralNotes._();
3+
4+
static const unshield =
5+
"Masternode collateral unshield (1000 FIRO to transparent).";
6+
static const prep = "Masternode collateral prep (1000 FIRO self-send).";
7+
8+
static bool isUnshield(String? note) =>
9+
note != null && note.contains(unshield);
10+
11+
static bool isPrep(String? note) => note != null && note.contains(prep);
12+
}

0 commit comments

Comments
 (0)