Skip to content

Commit 025ecb5

Browse files
Merge pull request #11 from codebuilderinc/copilot/sub-pr-10
Fix redundant navigation in permissions tab press handler
2 parents 14ea0b2 + bcfdd9c commit 025ecb5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

app/(tabs)/_layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ export default function TabLayout() {
5757
tabPress: (e: { preventDefault: () => void }) => {
5858
// If already on a permissions sub-page (not the index), navigate to permissions index
5959
const isOnPermissionsSubPage = pathname.startsWith('/permissions/') && pathname !== '/permissions';
60-
const isOnPermissionsIndex = pathname === '/permissions' || pathname === '/(tabs)/permissions';
61-
62-
if (isOnPermissionsSubPage || isOnPermissionsIndex) {
60+
61+
if (isOnPermissionsSubPage) {
6362
// Prevent default tab behavior
6463
e.preventDefault();
6564
// Navigate to permissions index, replacing the current route to reset the stack

0 commit comments

Comments
 (0)