diff --git a/client/src/App.tsx b/client/src/App.tsx index 539f478689..889780a9c8 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -31,11 +31,13 @@ const user = { name: 'Emily Selman', }; -const automationNavigation: { +type NavigationType = { name: string; href: string; icon: LucideIcon; -}[] = [ +}; + +const automationNavigation: NavigationType[] = [ { href: '/automation/projects', icon: FolderIcon, @@ -59,11 +61,7 @@ const automationNavigation: { }, ]; -const embeddedNavigation: { - name: string; - href: string; - icon: LucideIcon; -}[] = [ +const embeddedNavigation: NavigationType[] = [ { href: '/embedded/integrations', icon: SquareIcon, @@ -115,11 +113,13 @@ function App() { return true; }); - const navigation = location.pathname.includes('automation') - ? filteredAutomationNavigation - : location.pathname.includes('embedded') - ? embeddedNavigation - : []; + let navigation: NavigationType[] = []; + + if (location.pathname.includes('automation')) { + navigation = filteredAutomationNavigation; + } else if (location.pathname.includes('embedded')) { + navigation = embeddedNavigation; + } useFetchInterceptor(); @@ -154,11 +154,7 @@ function App() { } }, [authenticated, sessionHasBeenFetched, navigate]); - if (!authenticated) { - return <>>; - } - - if (loadingFeatureFlags) { + if (!authenticated || loadingFeatureFlags) { return <>>; } diff --git a/client/src/pages/platform/copilot/CopilotPanel.tsx b/client/src/pages/platform/copilot/CopilotPanel.tsx index acd4e64047..6f5cae9568 100644 --- a/client/src/pages/platform/copilot/CopilotPanel.tsx +++ b/client/src/pages/platform/copilot/CopilotPanel.tsx @@ -24,7 +24,7 @@ const CopilotPanel = () => {