mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
chore(migrate): update migration logic for version 145 and enforce showMessageOutline default (#9805)
This commit is contained in:
parent
94374e7de2
commit
a34141c912
@ -67,7 +67,7 @@ const persistedReducer = persistReducer(
|
||||
{
|
||||
key: 'cherry-studio',
|
||||
storage,
|
||||
version: 144,
|
||||
version: 145,
|
||||
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs'],
|
||||
migrate
|
||||
},
|
||||
|
||||
@ -2333,6 +2333,19 @@ const migrateConfig = {
|
||||
logger.error('migrate 144 error', error as Error)
|
||||
return state
|
||||
}
|
||||
},
|
||||
'145': (state: RootState) => {
|
||||
try {
|
||||
if (state.settings) {
|
||||
if (state.settings.showMessageOutline === undefined || state.settings.showMessageOutline === null) {
|
||||
state.settings.showMessageOutline = false
|
||||
}
|
||||
}
|
||||
return state
|
||||
} catch (error) {
|
||||
logger.error('migrate 145 error', error as Error)
|
||||
return state
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ export interface SettingsState {
|
||||
navbarPosition: 'left' | 'top'
|
||||
// API Server
|
||||
apiServer: ApiServerConfig
|
||||
showMessageOutline?: boolean
|
||||
showMessageOutline: boolean
|
||||
// Notes Related
|
||||
showWorkspace: boolean
|
||||
}
|
||||
@ -409,7 +409,7 @@ export const initialState: SettingsState = {
|
||||
port: 23333,
|
||||
apiKey: `cs-sk-${uuid()}`
|
||||
},
|
||||
showMessageOutline: undefined,
|
||||
showMessageOutline: false,
|
||||
// Notes Related
|
||||
showWorkspace: true
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user