Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

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

at a876aae44ea07494ebea9727350aa060b81f317b 23 lines 750 B view raw
1import {StackActions, useNavigation} from '@react-navigation/native' 2 3import {type NavigationProp} from '#/lib/routes/types' 4import {router} from '#/routes' 5 6export function useGoBack(onGoBack?: () => unknown) { 7 const navigation = useNavigation<NavigationProp>() 8 return () => { 9 onGoBack?.() 10 if (navigation.canGoBack()) { 11 navigation.goBack() 12 } else { 13 navigation.navigate('HomeTab') 14 // Checking the state for routes ensures that web doesn't encounter errors while going back 15 if (navigation.getState()?.routes) { 16 navigation.dispatch(StackActions.push(...router.matchPath('/'))) 17 } else { 18 navigation.navigate('HomeTab') 19 navigation.dispatch(StackActions.popToTop()) 20 } 21 } 22 } 23}