From 2004bdebbfd0bc6fe4e4563e7b06d074dbf3f62a Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Sun, 24 Jul 2022 11:37:38 -0400
Subject: fix calibration menu in controller settings

---
 frontend/src/router-hook.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'frontend/src/router-hook.tsx')

diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx
index ce0c553f..e318930e 100644
--- a/frontend/src/router-hook.tsx
+++ b/frontend/src/router-hook.tsx
@@ -41,10 +41,10 @@ class RouterHook extends Logger {
     const DeckyWrapper = ({ children }: { children: ReactElement }) => {
       const { routes } = useDeckyRouterState();
 
-      const routerIndex = children.props.children[0].props.children.length - 1;
+      const routerIndex = children.props.children[0].props.children.length;
       if (
-        !children.props.children[0].props.children[routerIndex].length ||
-        children.props.children[0].props.children !== routes.size
+        !children.props.children[0].props.children[routerIndex]?.length ||
+        children.props.children[0].props.children[routerIndex].length !== routes.size
       ) {
         const newRouterArray: ReactElement[] = [];
         routes.forEach(({ component, props }, path) => {
-- 
cgit v1.2.3

