Skip to content

Commit

Permalink
chore: update store version and migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Jan 14, 2025
1 parent cb3ed42 commit de3206b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 54,
version: 55,
blacklist: ['runtime'],
migrate
},
Expand Down
14 changes: 14 additions & 0 deletions src/renderer/src/store/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit de3206b

Please sign in to comment.