Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Fix new post button on web after following intent URL (#3044)

* Fix new post button on web after following intent URL

* Ensure that `routes` exists before attempting to use it

authored by

Hailey and committed by
GitHub
e950463f 8bf40b46

+12 -5
+9 -2
src/Navigation.tsx
··· 485 485 }, 486 486 487 487 getStateFromPath(path: string) { 488 + const [name, params] = router.matchPath(path) 489 + 488 490 // Any time we receive a url that starts with `intent/` we want to ignore it here. It will be handled in the 489 491 // intent handler hook. We should check for the trailing slash, because if there isn't one then it isn't a valid 490 492 // intent 491 - if (path.includes('intent/')) return 493 + // On web, there is no route state that's created by default, so we should initialize it as the home route. On 494 + // native, since the home tab and the home screen are defined as initial routes, we don't need to return a state 495 + // since it will be created by react-navigation. 496 + if (path.includes('intent/')) { 497 + if (isNative) return 498 + return buildStateObject('Flat', 'Home', params) 499 + } 492 500 493 - const [name, params] = router.matchPath(path) 494 501 if (isNative) { 495 502 if (name === 'Search') { 496 503 return buildStateObject('SearchTab', 'Search', params)
+3 -3
src/view/shell/desktop/LeftNav.tsx
··· 200 200 const fetchHandle = useFetchHandle() 201 201 202 202 const getProfileHandle = async () => { 203 - const {routes} = getState() 204 - const currentRoute = routes[routes.length - 1] 203 + const routes = getState()?.routes 204 + const currentRoute = routes?.[routes?.length - 1] 205 205 206 - if (currentRoute.name === 'Profile') { 206 + if (currentRoute?.name === 'Profile') { 207 207 let handle: string | undefined = ( 208 208 currentRoute.params as CommonNavigatorParams['Profile'] 209 209 ).name