From 1125c757fe9c59b93dbff44d5225246584402275 Mon Sep 17 00:00:00 2001 From: zarzet Date: Wed, 25 Mar 2026 22:33:04 +0700 Subject: [PATCH] fix: remove unintended home reset on tab switch --- lib/screens/main_shell.dart | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/screens/main_shell.dart b/lib/screens/main_shell.dart index 5e2a118a..61feab23 100644 --- a/lib/screens/main_shell.dart +++ b/lib/screens/main_shell.dart @@ -261,7 +261,6 @@ class _MainShellState extends ConsumerState if (_currentIndex != index) { final previousIndex = _currentIndex; final isNonAdjacentJump = (previousIndex - index).abs() > 1; - final shouldResetHome = index == 0; HapticFeedback.selectionClick(); setState(() => _currentIndex = index); final showStore = ref.read( @@ -272,9 +271,6 @@ class _MainShellState extends ConsumerState showStoreTab: showStore, ); FocusManager.instance.primaryFocus?.unfocus(); - if (shouldResetHome) { - _resetHomeToMain(); - } // Jump directly when skipping intermediate tabs to avoid // sliding through them. For those jumps, keep a short fade-in // so the transition still feels intentional. @@ -292,7 +288,6 @@ class _MainShellState extends ConsumerState } void _onPageChanged(int index) { - final previousIndex = _currentIndex; if (_currentIndex != index) { setState(() => _currentIndex = index); final showStore = ref.read( @@ -303,9 +298,6 @@ class _MainShellState extends ConsumerState showStoreTab: showStore, ); FocusManager.instance.primaryFocus?.unfocus(); - if (index == 0 && previousIndex != 0) { - _resetHomeToMain(); - } } }