fix:quick actions cold start (#3476)
What changed, and why it matters
This commit fixes a bug where app shortcuts (quick actions) didn't work correctly when the wallet app was started from a cold state. It also updates the 'receive' shortcut to open the newer receive page instead of the older address page. There is no clear security issue here; it is a routine UI/UX bug fix.
No security action required. Treat as a normal functional bug fix.
Security signals we found
No security-relevant signals observed in the diff
Change is purely UI routing and navigation timing
No input validation, authentication, cryptographic, or permission changes
Evidence from the diff
The patch makes three related changes: (1) wraps a post-authentication navigation call in unawaited(...) so the quick-action link handling can proceed without blocking on the dashboard route transition; (2) registers a new route Routes.newReceivePage that points to NewReceivePage when the new UI feature flag is enabled, falling back to AddressPage; and (3) changes the deep-link/quick-action ‘receive’ handler from Routes.addressPage to Routes.newReceivePage.
Changed components
lib/reactions/on_authentication_state_change.dartlib/router.dartlib/routes.dartlib/view_model/link_view_model.dartInspect captured patch +16 / −2
diff --git a/lib/reactions/on_authentication_state_change.dart b/lib/reactions/on_authentication_state_change.dart
index 02ddd563..d63c5478 100644
--- a/lib/reactions/on_authentication_state_change.dart
+++ b/lib/reactions/on_authentication_state_change.dart
@@ -146,7 +146,9 @@ void startAuthenticationStateChange(
),
);
} else {
- await navigatorKey.currentState!.pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
+ unawaited(
+ navigatorKey.currentState!.pushNamedAndRemoveUntil(Routes.dashboard, (route) => false),
+ );
}
WidgetsBinding.instance.addPostFrameCallback((_) {
final linkViewModel = getIt.get<LinkViewModel>();
diff --git a/lib/router.dart b/lib/router.dart
index a130b266..837eab8c 100644
--- a/lib/router.dart
+++ b/lib/router.dart
@@ -11,6 +11,7 @@ import 'package:cake_wallet/new-ui/pages/bridge/bridge_receiving_wallet_page.dar
import 'package:cake_wallet/new-ui/pages/coin_control_page.dart';
import 'package:cake_wallet/new-ui/pages/addresses_page.dart';
import 'package:cake_wallet/new-ui/pages/lightning_username_page.dart';
+import "package:cake_wallet/new-ui/pages/receive_page.dart";
import 'package:cake_wallet/new-ui/pages/send_page.dart';
import 'package:cake_wallet/order/order.dart';
import 'package:cake_wallet/core/new_wallet_type_arguments.dart';
@@ -469,6 +470,16 @@ Route<dynamic> createRoute(RouteSettings settings) {
return handleRouteWithPlatformAwareness((context) => getIt.get<AddressPage>(),
settings: settings);
+ case Routes.newReceivePage:
+ if (FeatureFlag.hasNewUi) {
+ return handleRouteWithPlatformAwareness(
+ (context) => Material(child: getIt.get<NewReceivePage>(param1: false, param2: null)),
+ settings: settings,
+ );
+ }
+ return handleRouteWithPlatformAwareness((context) => getIt.get<AddressPage>(),
+ settings: settings);
+
case Routes.transactionDetails:
return CupertinoPageRoute<void>(
fullscreenDialog: true,
diff --git a/lib/routes.dart b/lib/routes.dart
index 96ac8264..236196bf 100644
--- a/lib/routes.dart
+++ b/lib/routes.dart
@@ -71,6 +71,7 @@ class Routes {
static const unspentCoinsList = '/unspent_coins_list';
static const unspentCoinsDetails = '/unspent_coins_details';
static const addressPage = '/address_page';
+ static const newReceivePage = '/new_receive_page';
static const fullscreenQR = '/fullscreen_qr';
static const cakePayWelcomePage = '/cake_pay_welcome_page';
static const cakePayLoginPage = '/cake_pay_login_page';
diff --git a/lib/view_model/link_view_model.dart b/lib/view_model/link_view_model.dart
index a9e74273..f14718ec 100644
--- a/lib/view_model/link_view_model.dart
+++ b/lib/view_model/link_view_model.dart
@@ -47,7 +47,7 @@ class LinkViewModel {
case 'send':
return Routes.send;
case 'receive':
- return Routes.addressPage;
+ return Routes.newReceivePage;
default:
return null;
}
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.