Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
isSpark: wallet is FiroWallet && !firoPublicSend,
onCancel: () {
wasCancelled = true;
Navigator.of(context).pop();
},
);
},
Expand Down
5 changes: 2 additions & 3 deletions lib/pages/salvium_stake/salvium_create_stake_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ class _SalviumCreateStakeViewState
if (_lock) return;
_lock = true;

bool wasCancelled = false;
try {
bool wasCancelled = false;

unawaited(
showDialog<dynamic>(
context: context,
Expand Down Expand Up @@ -169,7 +168,7 @@ class _SalviumCreateStakeViewState
} catch (e, s) {
Logging.instance.e("Salvium stake preview: ", error: e, stackTrace: s);

if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context, rootNavigator: Util.isDesktop).pop();

Expand Down
5 changes: 2 additions & 3 deletions lib/pages/send_view/send_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,8 @@ class _SendViewState extends ConsumerState<SendView> {
}
}

bool wasCancelled = false;
try {
bool wasCancelled = false;

if (mounted) {
unawaited(
showDialog<void>(
Expand Down Expand Up @@ -1162,7 +1161,7 @@ class _SendViewState extends ConsumerState<SendView> {
}
} catch (e, s) {
Logging.instance.e("$e\n$s", error: e, stackTrace: s);
if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context, rootNavigator: true).pop();

Expand Down
5 changes: 2 additions & 3 deletions lib/pages/send_view/sol_token_send_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ class _SolTokenSendViewState extends ConsumerState<SolTokenSendView> {
final wallet = ref.read(pWallets).getWallet(walletId);
final Amount amount = _amountToSend!;

bool wasCancelled = false;
try {
bool wasCancelled = false;

if (mounted) {
unawaited(
showDialog<void>(
Expand Down Expand Up @@ -503,7 +502,7 @@ class _SolTokenSendViewState extends ConsumerState<SolTokenSendView> {
}
} catch (e, s) {
Logging.instance.e("$e\n$s", error: e, stackTrace: s);
if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context).pop();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class _RestoringDialogState extends ConsumerState<BuildingTransactionDialog> {
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();
onCancel.call();
},
),
Expand All @@ -140,7 +139,6 @@ class _RestoringDialogState extends ConsumerState<BuildingTransactionDialog> {
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();
onCancel.call();
},
),
Expand Down
5 changes: 2 additions & 3 deletions lib/pages/send_view/token_send_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,8 @@ class _TokenSendViewState extends ConsumerState<TokenSendView> {
// }
// }

bool wasCancelled = false;
try {
bool wasCancelled = false;

if (mounted) {
unawaited(
showDialog<void>(
Expand Down Expand Up @@ -533,7 +532,7 @@ class _TokenSendViewState extends ConsumerState<TokenSendView> {
}
} catch (e, s) {
Logging.instance.e("$e\n$s", error: e, stackTrace: s);
if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context).pop();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,8 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
}
}

bool wasCancelled = false;
try {
bool wasCancelled = false;

if (mounted) {
unawaited(
showDialog<dynamic>(
Expand Down Expand Up @@ -780,7 +779,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
}
} catch (e, s) {
Logging.instance.e("Desktop send: ", error: e, stackTrace: s);
if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context, rootNavigator: true).pop();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ class _DesktopSolTokenSendState extends ConsumerState<DesktopSolTokenSend> {
}
}

bool wasCancelled = false;
try {
bool wasCancelled = false;

if (mounted) {
unawaited(
showDialog<dynamic>(
Expand Down Expand Up @@ -292,7 +291,7 @@ class _DesktopSolTokenSendState extends ConsumerState<DesktopSolTokenSend> {
);
}
} catch (e) {
if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context, rootNavigator: true).pop();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ class _DesktopTokenSendState extends ConsumerState<DesktopTokenSend> {
}
}

bool wasCancelled = false;
try {
bool wasCancelled = false;

if (mounted) {
unawaited(
showDialog<dynamic>(
Expand Down Expand Up @@ -275,7 +274,7 @@ class _DesktopTokenSendState extends ConsumerState<DesktopTokenSend> {
);
}
} catch (e) {
if (mounted) {
if (mounted && !wasCancelled) {
// pop building dialog
Navigator.of(context, rootNavigator: true).pop();

Expand Down
Loading
Loading