Skip to content

Commit

Permalink
fix(load-ai-chat): load ai-chat feature by default
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed Aug 16, 2024
1 parent b3e6a27 commit 3c51f7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/App/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const hasOnlyNameProperty = (obj: object | null | undefined): boolean => {
}

export const SideBar = () => {
const { sidebarIsOpen } = useAppStore((s) => s)
const { sidebarIsOpen, universeQuestionIsOpen } = useAppStore((s) => s)
const selectedNode = useSelectedNode()

const subViewIsOpen =
Expand All @@ -66,9 +66,11 @@ export const SideBar = () => {

return (
<>
<Slide direction="right" in={sidebarIsOpen} mountOnEnter unmountOnExit>
<Content subViewOpen={subViewIsOpen} />
</Slide>
{!universeQuestionIsOpen && (
<Slide direction="right" in={sidebarIsOpen} mountOnEnter unmountOnExit>
<Content subViewOpen={subViewIsOpen} />
</Slide>
)}
<SideBarSubView open={subViewIsOpen} />
{!sidebarIsOpen && <Tab />}
</>
Expand Down
13 changes: 12 additions & 1 deletion src/components/AppContainer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
import { lazy, Suspense } from 'react'
import { lazy, Suspense, useEffect } from 'react'
import { Route, Routes } from 'react-router-dom'
import { useDataStore } from '~/stores/useDataStore'
import { E2ETests } from '~/utils'
import { AppProviders } from '../App/Providers'
import { Splash } from '../App/Splash'
import { AuthGuard } from '../Auth'
import { useAppStore } from '~/stores/useAppStore'

const LazyApp = lazy(() => import('../App').then(({ App }) => ({ default: App })))

export const AppContainer = () => {
const App = <LazyApp />
const { splashDataLoading } = useDataStore((s) => s)

const { setUniverseQuestionIsOpen } = useAppStore((s) => ({
setUniverseQuestionIsOpen: s.setUniverseQuestionIsOpen,
}))

useEffect(() => {
if (!splashDataLoading) {
setUniverseQuestionIsOpen()
}
}, [splashDataLoading, setUniverseQuestionIsOpen])

return (
<AppProviders>
{splashDataLoading && <Splash />}
Expand Down

0 comments on commit 3c51f7f

Please sign in to comment.