fix: engine settings GUI - feature toggle (#1252)
## Description This feature is not fully implemented. Blocking issues: #1250
This commit is contained in:
parent
1ec8174700
commit
850a42cfb0
@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import React, { useContext } from 'react'
|
||||||
|
|
||||||
import { getUserSpace, openFileExplorer, joinPath } from '@janhq/core'
|
import { getUserSpace, openFileExplorer, joinPath } from '@janhq/core'
|
||||||
|
|
||||||
@ -14,6 +14,8 @@ import DropdownListSidebar, {
|
|||||||
selectedModelAtom,
|
selectedModelAtom,
|
||||||
} from '@/containers/DropdownListSidebar'
|
} from '@/containers/DropdownListSidebar'
|
||||||
|
|
||||||
|
import { FeatureToggleContext } from '@/context/FeatureToggle'
|
||||||
|
|
||||||
import { useCreateNewThread } from '@/hooks/useCreateNewThread'
|
import { useCreateNewThread } from '@/hooks/useCreateNewThread'
|
||||||
|
|
||||||
import { toSettingParams } from '@/utils/model_param'
|
import { toSettingParams } from '@/utils/model_param'
|
||||||
@ -35,6 +37,7 @@ const Sidebar: React.FC = () => {
|
|||||||
const selectedModel = useAtomValue(selectedModelAtom)
|
const selectedModel = useAtomValue(selectedModelAtom)
|
||||||
const { updateThreadMetadata } = useCreateNewThread()
|
const { updateThreadMetadata } = useCreateNewThread()
|
||||||
const threadStates = useAtomValue(threadStatesAtom)
|
const threadStates = useAtomValue(threadStatesAtom)
|
||||||
|
const { experimentalFeatureEnabed } = useContext(FeatureToggleContext)
|
||||||
|
|
||||||
const activeModelParams = useAtomValue(getActiveThreadModelParamsAtom)
|
const activeModelParams = useAtomValue(getActiveThreadModelParamsAtom)
|
||||||
const modelSettingParams = toSettingParams(activeModelParams)
|
const modelSettingParams = toSettingParams(activeModelParams)
|
||||||
@ -197,7 +200,7 @@ const Sidebar: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CardSidebar>
|
</CardSidebar>
|
||||||
{Object.keys(modelSettingParams).length ? (
|
{experimentalFeatureEnabed && Object.keys(modelSettingParams).length ? (
|
||||||
<CardSidebar
|
<CardSidebar
|
||||||
title="Engine"
|
title="Engine"
|
||||||
onRevealInFinderClick={onReviewInFinderClick}
|
onRevealInFinderClick={onReviewInFinderClick}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user