fix: Remove duplicate empty LM Studio providers

This commit is contained in:
kangfenmao 2025-02-22 13:35:14 +08:00
parent 7677850547
commit b83343a8b9
3 changed files with 12 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -30,7 +30,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 71,
version: 72,
blacklist: ['runtime'],
migrate
},

View File

@ -1110,6 +1110,17 @@ const migrateConfig = {
state.minapps.enabled.push(monica)
}
}
// remove duplicate lmstudio providers
const emptyLmStudioProviderIndex = state.llm.providers.findLastIndex(
(provider) => provider.id === 'lmstudio' && provider.models.length === 0
)
if (emptyLmStudioProviderIndex !== -1) {
state.llm.providers.splice(emptyLmStudioProviderIndex, 1)
}
return state
}
}