A personal media tracker built on the AT Protocol opnshelf.xyz
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: nested routes getting stuck

+13 -1
+13 -1
apps/mobile/app/(tabs)/_layout.tsx
··· 1 - import { Tabs } from "expo-router"; 1 + import { router, Tabs, usePathname } from "expo-router"; 2 2 import { Home, Search, User } from "lucide-react-native"; 3 3 import { useTheme } from "@/contexts/theme"; 4 4 5 5 export default function TabLayout() { 6 6 const { colors } = useTheme(); 7 + const pathname = usePathname(); 8 + 9 + const normalizedPath = pathname.replace(/^\/\(tabs\)/, ""); 10 + const isOnNestedProfileRoute = normalizedPath.startsWith("/profile/"); 7 11 8 12 return ( 9 13 <Tabs ··· 38 42 /> 39 43 <Tabs.Screen 40 44 name="profile" 45 + listeners={{ 46 + tabPress: (event) => { 47 + if (isOnNestedProfileRoute) { 48 + event.preventDefault(); 49 + router.navigate("/(tabs)/profile"); 50 + } 51 + }, 52 + }} 41 53 options={{ 42 54 title: "Profile", 43 55 tabBarIcon: ({ color, size }) => <User size={size} color={color} />,