Skip to content

Commit

Permalink
fix(ai-chat): ai screen on default part of feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoaibdev7 committed Oct 28, 2024
1 parent 9d27cfa commit c650a30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 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 (!splashDataLoading) {
if (chatInterfaceFeatureFlag && !splashDataLoading) {
setUniverseQuestionIsOpen()
}
}, [setUniverseQuestionIsOpen, splashDataLoading])
}, [setUniverseQuestionIsOpen, splashDataLoading, chatInterfaceFeatureFlag])

return (
<>
Expand All @@ -340,7 +340,7 @@ export const App = () => {
<Wrapper direction="row">
<FormProvider {...form}>
<LazyMainToolbar />
{!universeQuestionIsOpen && <LazySideBar />}
{!universeQuestionIsOpen && chatInterfaceFeatureFlag && <LazySideBar />}
<LazyUniverse />
<Overlay />
<AppBar />
Expand Down
7 changes: 1 addition & 6 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,7 @@ export const useAppStore = create<AppStore>((set, get) => ({
transcriptIsOpen: !sidebarIsOpen ? false : get().transcriptIsOpen,
}),
setTranscriptOpen: (transcriptIsOpen) => set({ transcriptIsOpen }),
setUniverseQuestionIsOpen: () => {
const { chatInterfaceFeatureFlag } = useFeatureFlagStore.getState()

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

0 comments on commit c650a30

Please sign in to comment.