Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Fix profile link 404s on session change & handle change [APP 523] (#507)

* Use DID to link to the user profile to gracefully handle... handle changes

* Reset nav state on active profile change

authored by

Paul Frazee and committed by
GitHub
0f5735b6 9f9bd314

+19 -3
+17 -3
src/Navigation.tsx
··· 1 1 import * as React from 'react' 2 2 import {StyleSheet} from 'react-native' 3 + import {observer} from 'mobx-react-lite' 3 4 import { 4 5 NavigationContainer, 5 6 createNavigationContainerRef, 7 + CommonActions, 6 8 StackActions, 7 9 } from '@react-navigation/native' 8 10 import {createNativeStackNavigator} from '@react-navigation/native-stack' ··· 163 165 ) 164 166 } 165 167 166 - function MyProfileTabNavigator() { 168 + const MyProfileTabNavigator = observer(() => { 167 169 const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) 168 170 const store = useStores() 169 171 return ( ··· 180 182 // @ts-ignore // TODO: fix this broken type in ProfileScreen 181 183 component={ProfileScreen} 182 184 initialParams={{ 183 - name: store.me.handle, 185 + name: store.me.did, 184 186 hideBackButton: true, 185 187 }} 186 188 /> 187 189 {commonScreens(MyProfileTab as typeof HomeTab)} 188 190 </MyProfileTab.Navigator> 189 191 ) 190 - } 192 + }) 191 193 192 194 /** 193 195 * The FlatNavigator is used by Web to represent the routes ··· 281 283 } 282 284 } 283 285 286 + function reset() { 287 + if (navigationRef.isReady()) { 288 + navigationRef.dispatch( 289 + CommonActions.reset({ 290 + index: 0, 291 + routes: [{name: isNative ? 'HomeTab' : 'Home'}], 292 + }), 293 + ) 294 + } 295 + } 296 + 284 297 function handleLink(url: string) { 285 298 let path 286 299 if (url.startsWith('/')) { ··· 326 339 export { 327 340 navigate, 328 341 resetToTab, 342 + reset, 329 343 handleLink, 330 344 TabsNavigator, 331 345 FlatNavigator,
+2
src/state/models/root-store.ts
··· 21 21 import {resetToTab} from '../../Navigation' 22 22 import {ImageSizesCache} from './cache/image-sizes' 23 23 import {MutedThreads} from './muted-threads' 24 + import {reset as resetNavigation} from '../../Navigation' 24 25 25 26 export const appInfo = z.object({ 26 27 build: z.string(), ··· 123 124 this.agent = agent 124 125 this.me.clear() 125 126 await this.me.load() 127 + resetNavigation() 126 128 } 127 129 128 130 /**