From 847d4d19b5f0c9e59e91d33ac049b725236f3062 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 3 Oct 2023 19:55:44 -0700 Subject: Fix a potential reference error in bottombarweb (#1600) --- src/view/shell/bottom-bar/BottomBarWeb.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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' -- cgit 1.4.1