From 9d679d45bebf89284ba6300823428edbccd63acb Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 27 Oct 2025 16:34:25 +0800 Subject: [PATCH 1/2] route user to wallet page after login or logout --- lib/views/main_layout/main_layout.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/views/main_layout/main_layout.dart b/lib/views/main_layout/main_layout.dart index a64f61f82a..5156294596 100644 --- a/lib/views/main_layout/main_layout.dart +++ b/lib/views/main_layout/main_layout.dart @@ -77,6 +77,8 @@ class _MainLayoutState extends State { // Track when user has been logged in if (state.mode == AuthorizeMode.logIn) { QuickLoginSwitch.trackUserLoggedIn(); + // Always route to Wallet on login + routingState.selectedMenu = MainMenuValue.wallet; } // Only reset the remember me dialog flag if user was logged in and is now logged out @@ -86,6 +88,8 @@ class _MainLayoutState extends State { routingState.resetOnLogOut(); // Reset dialog state so it can be shown again after user logs out QuickLoginSwitch.resetOnLogout(); + // Always route to Wallet on logout + routingState.selectedMenu = MainMenuValue.wallet; } }, builder: (context, state) { From 5fd4b8855df493b23675f453fda7455d1abc8bb3 Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 27 Oct 2025 17:13:09 +0800 Subject: [PATCH 2/2] delay Wallet page routing until trezor pin/passphrase complete --- lib/views/main_layout/main_layout.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/views/main_layout/main_layout.dart b/lib/views/main_layout/main_layout.dart index 5156294596..c56061a2e2 100644 --- a/lib/views/main_layout/main_layout.dart +++ b/lib/views/main_layout/main_layout.dart @@ -73,22 +73,20 @@ class _MainLayoutState extends State { @override Widget build(BuildContext context) { return BlocConsumer( + listenWhen: (previous, current) => previous.mode != current.mode, listener: (context, state) { - // Track when user has been logged in + // Route after login completes (works for both software and hardware wallets) if (state.mode == AuthorizeMode.logIn) { QuickLoginSwitch.trackUserLoggedIn(); - // Always route to Wallet on login routingState.selectedMenu = MainMenuValue.wallet; + return; } - // Only reset the remember me dialog flag if user was logged in and is now logged out - // This prevents the flag from being reset on initial app startup + // Route after logout completes if (state.mode == AuthorizeMode.noLogin && QuickLoginSwitch.hasBeenLoggedInThisSession) { routingState.resetOnLogOut(); - // Reset dialog state so it can be shown again after user logs out QuickLoginSwitch.resetOnLogout(); - // Always route to Wallet on logout routingState.selectedMenu = MainMenuValue.wallet; } },