diff --git a/src/renderer/src/store/index.ts b/src/renderer/src/store/index.ts index 839fa279de..cdd3be560d 100644 --- a/src/renderer/src/store/index.ts +++ b/src/renderer/src/store/index.ts @@ -64,7 +64,7 @@ const persistedReducer = persistReducer( { key: 'cherry-studio', storage, - version: 136, + version: 137, blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs'], migrate }, diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index ee677ead39..155f0a50b0 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -3,6 +3,7 @@ import { nanoid } from '@reduxjs/toolkit' import { DEFAULT_CONTEXTCOUNT, DEFAULT_TEMPERATURE, isMac } from '@renderer/config/constant' import { DEFAULT_MIN_APPS } from '@renderer/config/minapps' import { isFunctionCallingModel, isNotSupportedTextDelta, SYSTEM_MODELS } from '@renderer/config/models' +import { BUILTIN_OCR_PROVIDERS, DEFAULT_OCR_PROVIDER } from '@renderer/config/ocr' import { TRANSLATE_PROMPT } from '@renderer/config/prompts' import { isSupportArrayContentProvider, @@ -2174,6 +2175,16 @@ const migrateConfig = { logger.error('migrate 136 error', error as Error) return state } + }, + '137': (state: RootState) => { + try { + state.ocr.providers = BUILTIN_OCR_PROVIDERS + state.ocr.imageProvider = DEFAULT_OCR_PROVIDER.image + return state + } catch (error) { + logger.error('migrate 136 error', error as Error) + return state + } } }