From 524be0d73969d6cb644e4c7d3a857d613f1e33b5 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Mon, 25 Nov 2024 16:27:40 -0300 Subject: [PATCH] Fix v1 build --- apps/connect-v1/src/components/atoms/NavBar.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/connect-v1/src/components/atoms/NavBar.tsx b/apps/connect-v1/src/components/atoms/NavBar.tsx index a8df2085..7e30e01a 100644 --- a/apps/connect-v1/src/components/atoms/NavBar.tsx +++ b/apps/connect-v1/src/components/atoms/NavBar.tsx @@ -73,11 +73,11 @@ export const NavBar = () => { const [items, setItems] = useState([...ENV.navBar]); const openSubMenuHandler = (index: number) => { const newItems = [...items]; - if (newItems[index].subMenu) { - if (newItems[index].subMenu) { - newItems[index].subMenu.open = !newItems[index].subMenu.open; - setItems(newItems); - } + const item = newItems[index]; + if (item && item.subMenu) { + item.subMenu.open = !item.subMenu?.open; + newItems[index] = item; + setItems(newItems); } }; return (