Skip to content

Commit

Permalink
fix: model switch not work when autoRegenAfterSwitchModel is false
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Mar 31, 2023
1 parent 665f203 commit cd20271
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ConversationCard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ function ConversationCard(props) {
required
onChange={(e) => {
const modelName = e.target.value
if (config.autoRegenAfterSwitchModel)
getRetryFn({ ...session, modelName, aiName: t(Models[modelName].desc) })()
const newSession = { ...session, modelName, aiName: t(Models[modelName].desc) }
if (config.autoRegenAfterSwitchModel) getRetryFn(newSession)()
else setSession(newSession)
}}
>
{Object.entries(Models).map(([key, model]) => {
Expand Down

0 comments on commit cd20271

Please sign in to comment.