fix(desktop): Show Create Masternode page as dialog
What changed, and why it matters
This commit changes how the 'Create Masternode' screen appears on desktop computers. Previously it was pushed as a full page after confirming a transaction; now it is shown as a popup dialog on desktop, while mobile behavior stays the same. It also adds a safety check that the screen context is still valid before showing the dialog. There is no clear security problem here—this looks like a normal user-interface fix.
No security action needed. Treat as a routine UI/UX fix.
Security signals we found
No security-relevant signals detected
UI-only change
Adds mounted guard before using BuildContext across async gap
Evidence from the diff
In lib/pages/send_view/confirm_transaction_view.dart, after a Firo masternode collateral transaction is confirmed, the code now checks navigator.context.mounted and, on desktop (Util.isDesktop), presents CreateMasternodeView inside an SDialog via showDialog with barrierDismissible: true. On non-desktop it continues to use navigator.pushNamed. The change adds an import for s_dialog.dart and replaces the previous unawaited navigator.pushNamed call with an awaited conditional branch.
Changed components
lib/pages/send_view/confirm_transaction_view.dartCreateMasternodeView presentation on desktopInspect captured patch +22 / −4
diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart
index c79f1ae..60c15ef 100644
--- a/lib/pages/send_view/confirm_transaction_view.dart
+++ b/lib/pages/send_view/confirm_transaction_view.dart
@@ -49,6 +49,7 @@ import '../masternodes/create_masternode_view.dart';
import '../../widgets/background.dart';
import '../../widgets/conditional_parent.dart';
import '../../widgets/custom_buttons/app_bar_icon_button.dart';
+import '../../widgets/dialogs/s_dialog.dart';
import '../../widgets/desktop/desktop_dialog.dart';
import '../../widgets/desktop/desktop_dialog_close_button.dart';
import '../../widgets/desktop/primary_button.dart';
@@ -561,8 +562,25 @@ class _ConfirmTransactionViewState
navigator.popUntil(
ModalRoute.withName(routeOnSuccessName),
);
- unawaited(
- navigator.pushNamed(
+ final dialogContext = navigator.context;
+ if (!dialogContext.mounted) {
+ return;
+ }
+ if (Util.isDesktop) {
+ await showDialog<Object>(
+ context: dialogContext,
+ barrierDismissible: true,
+ builder: (ctx) => SDialog(
+ child: CreateMasternodeView(
+ firoWalletId: walletId,
+ collateralTxid: confirmedTx.txid!,
+ collateralVout: collateralVout,
+ collateralAddress: mnRecipient.address,
+ ),
+ ),
+ );
+ } else {
+ await navigator.pushNamed(
CreateMasternodeView.routeName,
arguments: {
'walletId': walletId,
@@ -570,8 +588,8 @@ class _ConfirmTransactionViewState
'collateralVout': collateralVout,
'collateralAddress': mnRecipient.address,
},
- ),
- );
+ );
+ }
}
}
} else if (mnRecipient != null &&
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.