feat(migrate, websearch): enable enhanceMode in websearch and update migration logic
This commit is contained in:
parent
64200b00a9
commit
24e46efa0c
@ -1,6 +1,6 @@
|
|||||||
import { useShortcut, useShortcutDisplay } from '@renderer/hooks/useShortcuts'
|
import { useShortcut, useShortcutDisplay } from '@renderer/hooks/useShortcuts'
|
||||||
import { Tooltip } from 'antd'
|
import { Tooltip } from 'antd'
|
||||||
import { CircleFadingPlus } from 'lucide-react'
|
import { Eraser } from 'lucide-react'
|
||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
@ -20,7 +20,7 @@ const NewContextButton: FC<Props> = ({ onNewContext, ToolbarButton }) => {
|
|||||||
<Container>
|
<Container>
|
||||||
<Tooltip placement="top" title={t('chat.input.new.context', { Command: newContextShortcut })} arrow>
|
<Tooltip placement="top" title={t('chat.input.new.context', { Command: newContextShortcut })} arrow>
|
||||||
<ToolbarButton type="text" onClick={onNewContext}>
|
<ToolbarButton type="text" onClick={onNewContext}>
|
||||||
<CircleFadingPlus size={18} />
|
<Eraser size={18} />
|
||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Container>
|
</Container>
|
||||||
|
|||||||
@ -172,7 +172,17 @@ const AssistantItem: FC<AssistantItemProps> = ({ assistant, isActive, onSwitch,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[addAgent, addAssistant, onSwitch, removeAllTopics, t, onDelete, sortByPinyinAsc, sortByPinyinDesc]
|
[
|
||||||
|
addAgent,
|
||||||
|
addAssistant,
|
||||||
|
onDelete,
|
||||||
|
onSwitch,
|
||||||
|
removeAllTopics,
|
||||||
|
setAssistantIconType,
|
||||||
|
sortByPinyinAsc,
|
||||||
|
sortByPinyinDesc,
|
||||||
|
t
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
const handleSwitch = useCallback(async () => {
|
const handleSwitch = useCallback(async () => {
|
||||||
|
|||||||
@ -1220,14 +1220,10 @@ const migrateConfig = {
|
|||||||
state.settings.assistantIconType = state.settings?.showAssistantIcon ? 'model' : 'emoji'
|
state.settings.assistantIconType = state.settings?.showAssistantIcon ? 'model' : 'emoji'
|
||||||
// @ts-ignore eslint-disable-next-line
|
// @ts-ignore eslint-disable-next-line
|
||||||
delete state.settings.showAssistantIcon
|
delete state.settings.showAssistantIcon
|
||||||
return state
|
|
||||||
} catch (error) {
|
|
||||||
return state
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'97': (state: RootState) => {
|
|
||||||
try {
|
|
||||||
state.settings.enableBackspaceDeleteModel = true
|
state.settings.enableBackspaceDeleteModel = true
|
||||||
|
if (state.websearch) {
|
||||||
|
state.websearch.enhanceMode = true
|
||||||
|
}
|
||||||
return state
|
return state
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return state
|
return state
|
||||||
|
|||||||
@ -64,7 +64,7 @@ const initialState: WebSearchState = {
|
|||||||
maxResults: 5,
|
maxResults: 5,
|
||||||
excludeDomains: [],
|
excludeDomains: [],
|
||||||
subscribeSources: [],
|
subscribeSources: [],
|
||||||
enhanceMode: false,
|
enhanceMode: true,
|
||||||
overwrite: false
|
overwrite: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user