fix: Remove duplicate empty LM Studio providers

This commit is contained in:
kangfenmao 2025-02-22 13:35:14 +08:00
parent 626e72a4fe
commit da2137f8f1
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', key: 'cherry-studio',
storage, storage,
version: 71, version: 72,
blacklist: ['runtime'], blacklist: ['runtime'],
migrate migrate
}, },

View File

@ -1110,6 +1110,17 @@ const migrateConfig = {
state.minapps.enabled.push(monica) 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
} }
} }