Skip to content

Commit

Permalink
fix(test): cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoaibdev7 committed Oct 19, 2024
1 parent c4b3ed5 commit 125bdad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/components/Universe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { isDevelopment } from '~/constants'
import { useAppStore } from '~/stores/useAppStore'
import { useControlStore } from '~/stores/useControlStore'
import { useDataStore } from '~/stores/useDataStore'
import { useFeatureFlagStore } from '~/stores/useFeatureFlagStore'
import { useSelectedNode } from '~/stores/useGraphStore'
import { colors } from '~/utils/colors'
import { addToGlobalForE2e } from '~/utils/tests'
Expand Down Expand Up @@ -98,6 +99,10 @@ const _Universe = () => {
const isLoading = useDataStore((s) => s.isFetching)
const universeQuestionIsOpen = useAppStore((s) => s.universeQuestionIsOpen)

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

const onWheelHandler = useCallback(
(e: React.WheelEvent) => {
const { target } = e
Expand Down Expand Up @@ -143,7 +148,7 @@ const _Universe = () => {
</Suspense>
</Canvas>
</Suspense>
{universeQuestionIsOpen && <UniverseQuestion />}
{chatInterfaceFeatureFlag && universeQuestionIsOpen && <UniverseQuestion />}
{isLoading && <Preloader fullSize={false} />}
<Overlay />
</Wrapper>
Expand Down
6 changes: 1 addition & 5 deletions src/stores/useAppStore/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { create } from 'zustand'
import { TAboutParams } from '~/network/fetchSourcesData'
import { useFeatureFlagStore } from '~/stores/useFeatureFlagStore'

export type SecondarySidebarActiveTab = '' | 'sentiment' | 'sources' | 'about'

Expand Down Expand Up @@ -72,11 +71,8 @@ export const useAppStore = create<AppStore>((set, get) => ({
transcriptIsOpen: !sidebarIsOpen ? false : get().transcriptIsOpen,
}),
setTranscriptOpen: (transcriptIsOpen) => set({ transcriptIsOpen }),
setUniverseQuestionIsOpen: () => {
const { chatInterfaceFeatureFlag } = useFeatureFlagStore.getState()
setUniverseQuestionIsOpen: () => set({ universeQuestionIsOpen: !get().universeQuestionIsOpen }),

set({ universeQuestionIsOpen: chatInterfaceFeatureFlag ? !get().universeQuestionIsOpen : false })
},
setAppMetaData: (appMetaData) => set({ appMetaData }),
setShowCollapseButton: (showCollapseButton) => set({ showCollapseButton }),
setSelectedColor: (selectedColor) => set({ selectedColor }),
Expand Down

0 comments on commit 125bdad

Please sign in to comment.