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
This commit is contained in:
Hailey 2024-03-01 16:04:06 -08:00 committed by GitHub
parent 8bf40b46a0
commit e950463f71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View file

@ -200,10 +200,10 @@ function ComposeBtn() {
const fetchHandle = useFetchHandle()
const getProfileHandle = async () => {
const {routes} = getState()
const currentRoute = routes[routes.length - 1]
const routes = getState()?.routes
const currentRoute = routes?.[routes?.length - 1]
if (currentRoute.name === 'Profile') {
if (currentRoute?.name === 'Profile') {
let handle: string | undefined = (
currentRoute.params as CommonNavigatorParams['Profile']
).name