diff options
author | Hailey <me@haileyok.com> | 2024-03-01 16:04:06 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 16:04:06 -0800 |
commit | e950463f71bddbcf83926dcfd681320a53192c7a (patch) | |
tree | d978e029512f5cab11ecce4b22b912f419deda3c /src/view | |
parent | 8bf40b46a00fd130a614b3446c98df1d421f970e (diff) | |
download | voidsky-e950463f71bddbcf83926dcfd681320a53192c7a.tar.zst |
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
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index fbc90bfc6..def0333c7 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -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 |