fix(shopinbit): don't tear down the payment dialog when opening Send from
What changed, and why it matters
This commit fixes a user-experience bug in the Stack Wallet app's ShopInBit payment flow on desktop. Previously, opening the 'send from' wallet dialog would close the entire payment dialog, so after sending funds the user was dumped back at the Services page instead of returning to the payment view. The change keeps the payment dialog open underneath the send dialog. There is no security vulnerability here—just a navigation/UI behavior fix.
No security action needed. Treat as a normal UI/UX fix and verify the desktop ShopInBit payment flow returns to the payment view after sending funds.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes the popDesktopBeforeShow parameter and its usage from shopinbit_payment_shared.dart and shopinbit_payment_view.dart. On desktop, the code no longer calls Navigator.of(context, rootNavigator: true).pop() before showing the ShopInBitSendFromView dialog. The comment explains that popping first tore down the nested navigator dialog, breaking the expected return path. The fix shows the send dialog on top of the existing payment dialog so the flow remains intact.
Changed components
lib/pages/shopinbit/shopinbit_payment_shared.dartlib/pages/shopinbit/shopinbit_payment_view.dartInspect captured patch +4 / −8
diff --git a/lib/pages/shopinbit/shopinbit_payment_shared.dart b/lib/pages/shopinbit/shopinbit_payment_shared.dart
index befd4e2..04f4913 100644
--- a/lib/pages/shopinbit/shopinbit_payment_shared.dart
+++ b/lib/pages/shopinbit/shopinbit_payment_shared.dart
@@ -140,13 +140,13 @@ Future<void> _pushShopInBitSendFrom({
required String address,
required int apiTicketId,
EthContract? tokenContract,
- bool popDesktopBeforeShow = false,
String? routeOnSuccessName,
}) async {
if (Util.isDesktop) {
- if (popDesktopBeforeShow) {
- Navigator.of(context, rootNavigator: true).pop();
- }
+ // Show the send-from dialog on top of the payment dialog. Do not pop the
+ // payment flow first: doing so tears down the whole nested-navigator
+ // dialog, so closing send-from would drop the user back to Services
+ // instead of returning to the payment view.
await showDialog<void>(
context: context,
builder: (_) => ShopInBitSendFromView(
@@ -185,7 +185,6 @@ Future<bool> tryNavigateToShopInBitWalletSend({
required String address,
required Amount? amount,
required int apiTicketId,
- bool popDesktopBeforeShow = false,
String? routeOnSuccessName,
}) async {
if (address.isEmpty) return false;
@@ -198,7 +197,6 @@ Future<bool> tryNavigateToShopInBitWalletSend({
amount: amount,
address: address,
apiTicketId: apiTicketId,
- popDesktopBeforeShow: popDesktopBeforeShow,
routeOnSuccessName: routeOnSuccessName,
);
return true;
@@ -219,7 +217,6 @@ Future<bool> tryNavigateToShopInBitWalletSend({
address: address,
apiTicketId: apiTicketId,
tokenContract: tokenContract,
- popDesktopBeforeShow: popDesktopBeforeShow,
routeOnSuccessName: routeOnSuccessName,
);
return true;
diff --git a/lib/pages/shopinbit/shopinbit_payment_view.dart b/lib/pages/shopinbit/shopinbit_payment_view.dart
index 97888d0..5eba672 100644
--- a/lib/pages/shopinbit/shopinbit_payment_view.dart
+++ b/lib/pages/shopinbit/shopinbit_payment_view.dart
@@ -222,7 +222,6 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
address: target.address,
amount: target.amount,
apiTicketId: widget.apiTicketId,
- popDesktopBeforeShow: true,
)) {
return;
}
Why this scored 17/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.