fix: 默认模型在模型服务中禁用后显示错误 #266

This commit is contained in:
kangfenmao 2024-11-02 15:11:36 +08:00
parent 41c3895da4
commit dd4239da87

View File

@ -9,7 +9,8 @@ export const getModelUniqId = (m?: Model) => {
export const hasModel = (m?: Model) => {
const allModels = store
.getState()
.llm.providers.map((p) => p.models)
.llm.providers.filter((p) => p.enabled)
.map((p) => p.models)
.flat()
return allModels.find((model) => model.id === m?.id)