fix(Inputbar): simplify assistant state reset logic in useEffect
This commit is contained in:
parent
8fbedb2bd0
commit
d1cb7258d2
@ -145,14 +145,10 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic, topic }) =
|
|||||||
}
|
}
|
||||||
}, [textareaHeight])
|
}, [textareaHeight])
|
||||||
|
|
||||||
// reset state when assistant changes
|
// Reset to assistant knowledge mcp servers
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Reset to assistant default model
|
|
||||||
assistant.defaultModel && setModel(assistant.defaultModel)
|
|
||||||
|
|
||||||
// Reset to assistant knowledge mcp servers
|
|
||||||
setEnabledMCPs(assistant.mcpServers || [])
|
setEnabledMCPs(assistant.mcpServers || [])
|
||||||
}, [assistant, setModel])
|
}, [assistant])
|
||||||
|
|
||||||
const sendMessage = useCallback(async () => {
|
const sendMessage = useCallback(async () => {
|
||||||
if (inputEmpty || loading) {
|
if (inputEmpty || loading) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user