From 9fb3959b33b12690c7cf757da9ea2a2db6c31e71 Mon Sep 17 00:00:00 2001 From: josc146 Date: Thu, 13 Apr 2023 19:46:04 +0800 Subject: [PATCH] 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) --- src/components/ConversationCard/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ConversationCard/index.jsx b/src/components/ConversationCard/index.jsx index 6cbe991..17af330 100644 --- a/src/components/ConversationCard/index.jsx +++ b/src/components/ConversationCard/index.jsx @@ -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) }} >