chore: update store version and migration

This commit is contained in:
kangfenmao 2025-01-14 14:32:51 +08:00
parent cb3ed42846
commit de3206b052
2 changed files with 15 additions and 1 deletions

View File

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

View File

@ -9,6 +9,7 @@ import { isEmpty } from 'lodash'
import { createMigrate } from 'redux-persist'
import { RootState } from '.'
import { DEFAULT_SIDEBAR_ICONS } from './settings'
const migrateConfig = {
'2': (state: RootState) => {
@ -784,6 +785,19 @@ const migrateConfig = {
system: false
})
}
state.settings.sidebarIcons = {
visible: DEFAULT_SIDEBAR_ICONS,
disabled: []
}
return state
},
'55': (state: RootState) => {
if (!state.settings.sidebarIcons) {
state.settings.sidebarIcons = {
visible: DEFAULT_SIDEBAR_ICONS,
disabled: []
}
}
return state
}
}