mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
fix(Inputbar): simplify assistant state reset logic in useEffect
This commit is contained in:
parent
9e00b443f6
commit
a386ad02ba
@ -145,14 +145,10 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic, topic }) =
|
||||
}
|
||||
}, [textareaHeight])
|
||||
|
||||
// reset state when assistant changes
|
||||
// Reset to assistant knowledge mcp servers
|
||||
useEffect(() => {
|
||||
// Reset to assistant default model
|
||||
assistant.defaultModel && setModel(assistant.defaultModel)
|
||||
|
||||
// Reset to assistant knowledge mcp servers
|
||||
setEnabledMCPs(assistant.mcpServers || [])
|
||||
}, [assistant, setModel])
|
||||
}, [assistant])
|
||||
|
||||
const sendMessage = useCallback(async () => {
|
||||
if (inputEmpty || loading) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user