mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
feat(store): 更新持久化存储版本并添加OCR配置迁移
添加137版本迁移逻辑,初始化OCR提供者和默认图像提供者配置
This commit is contained in:
parent
a6aee21a96
commit
e79bfcee77
@ -64,7 +64,7 @@ const persistedReducer = persistReducer(
|
||||
{
|
||||
key: 'cherry-studio',
|
||||
storage,
|
||||
version: 136,
|
||||
version: 137,
|
||||
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs'],
|
||||
migrate
|
||||
},
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user