fix: when the conversation is empty and Regenerate the answer after switching model is set, switching model will send useless requests, resulting in the problem of inability to input (#210)

This commit is contained in:
josc146
2023-04-13 19:46:04 +08:00
parent 96bc80c0fe
commit 9fb3959b33
+2 -1
View File
@@ -225,7 +225,8 @@ function ConversationCard(props) {
onChange={(e) => {
const modelName = e.target.value
const newSession = { ...session, modelName, aiName: Models[modelName].desc }
if (config.autoRegenAfterSwitchModel) getRetryFn(newSession)()
if (config.autoRegenAfterSwitchModel && conversationItemData.length > 0)
getRetryFn(newSession)()
else setSession(newSession)
}}
>