Skip to content

Commit

Permalink
fix(test): fix cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoaibdev7 committed Oct 15, 2024
1 parent 3f3ff98 commit 13ed57b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"functions": 36
},
"./src/network/": {
"lines": 29,
"lines": 30,
"branches": 9,
"functions": 18
}
Expand Down
9 changes: 9 additions & 0 deletions src/components/App/UniverseQuestion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import HelpIcon from '~/components/Icons/HelpIcon'
import { useAiSummaryStore } from '~/stores/useAiSummaryStore'
import { useAppStore } from '~/stores/useAppStore'
import { useDataStore } from '~/stores/useDataStore'
import { useFeatureFlagStore } from '~/stores/useFeatureFlagStore'
import { useUserStore } from '~/stores/useUserStore'
import { colors } from '~/utils/colors'

Expand Down Expand Up @@ -60,6 +61,10 @@ export const UniverseQuestion = () => {
}
}

const { chatInterfaceFeatureFlag } = useFeatureFlagStore((s) => ({
chatInterfaceFeatureFlag: s.chatInterfaceFeatureFlag,
}))

const handleSeedQuestionClick = async (seedQuestion: string) => {
setQuestion(seedQuestion)
await handleSubmitQuestion(seedQuestion)
Expand Down Expand Up @@ -87,6 +92,10 @@ export const UniverseQuestion = () => {

const isValidText = !!question && question.trim().length > 0

if (!chatInterfaceFeatureFlag) {
return null
}

return (
<Wrapper>
Ideas have shapes
Expand Down
10 changes: 5 additions & 5 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ export const App = () => {
}, [runningProjectId, setRunningProjectMessages])

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

return (
<>
Expand All @@ -336,11 +336,11 @@ export const App = () => {
<Leva hidden={!isDevelopment} />

<Suspense fallback={<div>Loading...</div>}>
{!splashDataLoading && chatInterfaceFeatureFlag ? (
{!splashDataLoading ? (
<Wrapper direction="row">
<FormProvider {...form}>
<LazyMainToolbar />
{!universeQuestionIsOpen && <LazySideBar />}
{chatInterfaceFeatureFlag ? !universeQuestionIsOpen && <LazySideBar /> : <LazySideBar />}
<LazyUniverse />
<Overlay />
<AppBar />
Expand All @@ -355,4 +355,4 @@ export const App = () => {
</Suspense>
</>
)
}
}

0 comments on commit 13ed57b

Please sign in to comment.