diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-10-03 19:55:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 19:55:44 -0700 |
commit | 847d4d19b5f0c9e59e91d33ac049b725236f3062 (patch) | |
tree | c3239ba7874696c28c56b2e272910b4e1d6dc851 | |
parent | 6598fca79d8f1253d6b74c9bbcf24fa384ffaa9b (diff) | |
download | voidsky-847d4d19b5f0c9e59e91d33ac049b725236f3062.tar.zst |
Fix a potential reference error in bottombarweb (#1600)
-rw-r--r-- | src/view/shell/bottom-bar/BottomBarWeb.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/view/shell/bottom-bar/BottomBarWeb.tsx b/src/view/shell/bottom-bar/BottomBarWeb.tsx index 6448eea63..e20214235 100644 --- a/src/view/shell/bottom-bar/BottomBarWeb.tsx +++ b/src/view/shell/bottom-bar/BottomBarWeb.tsx @@ -109,7 +109,12 @@ const NavItem: React.FC<{ href: string routeName: string }> = ({children, href, routeName}) => { - const currentRoute = useNavigationState(getCurrentRoute) + const currentRoute = useNavigationState(state => { + if (!state) { + return {name: 'Home'} + } + return getCurrentRoute(state) + }) const store = useStores() const isActive = currentRoute.name === 'Profile' |