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:
parent
8bf40b46a0
commit
e950463f71
2 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue