about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-10-03 19:55:44 -0700
committerGitHub <noreply@github.com>2023-10-03 19:55:44 -0700
commit847d4d19b5f0c9e59e91d33ac049b725236f3062 (patch)
treec3239ba7874696c28c56b2e272910b4e1d6dc851 /src
parent6598fca79d8f1253d6b74c9bbcf24fa384ffaa9b (diff)
downloadvoidsky-847d4d19b5f0c9e59e91d33ac049b725236f3062.tar.zst
Fix a potential reference error in bottombarweb (#1600)
Diffstat (limited to 'src')
-rw-r--r--src/view/shell/bottom-bar/BottomBarWeb.tsx7
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'