chore: update store version and migration

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

View File

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

View File

@ -9,6 +9,7 @@ import { isEmpty } from 'lodash'
import { createMigrate } from 'redux-persist' import { createMigrate } from 'redux-persist'
import { RootState } from '.' import { RootState } from '.'
import { DEFAULT_SIDEBAR_ICONS } from './settings'
const migrateConfig = { const migrateConfig = {
'2': (state: RootState) => { '2': (state: RootState) => {
@ -784,6 +785,19 @@ const migrateConfig = {
system: false 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 return state
} }
} }