feat(migrate): update migration logic to remove specific mini app from state and increment version to 89
This commit is contained in:
parent
c11adc01dc
commit
a3d124b9fd
@ -42,7 +42,7 @@ const persistedReducer = persistReducer(
|
||||
{
|
||||
key: 'cherry-studio',
|
||||
storage,
|
||||
version: 88,
|
||||
version: 89,
|
||||
blacklist: ['runtime', 'messages'],
|
||||
migrate
|
||||
},
|
||||
|
||||
@ -24,6 +24,13 @@ function removeMiniAppIconsFromState(state: RootState) {
|
||||
}
|
||||
}
|
||||
|
||||
function removeMiniAppFromState(state: RootState, id: string) {
|
||||
if (state.minapps) {
|
||||
state.minapps.enabled = state.minapps.enabled.filter((app) => app.id !== id)
|
||||
state.minapps.disabled = state.minapps.disabled.filter((app) => app.id !== id)
|
||||
}
|
||||
}
|
||||
|
||||
// add provider to state
|
||||
function addProvider(state: RootState, id: string) {
|
||||
if (!state.llm.providers.find((p) => p.id === id)) {
|
||||
@ -1159,12 +1166,18 @@ const migrateConfig = {
|
||||
state.mcp.servers = [{ ...defaultServer, id: nanoid() }, ...state.mcp.servers]
|
||||
}
|
||||
}
|
||||
return state
|
||||
} catch (error) {
|
||||
return state
|
||||
}
|
||||
},
|
||||
'89': (state: RootState) => {
|
||||
try {
|
||||
removeMiniAppFromState(state, 'aistudio')
|
||||
return state
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return state
|
||||
}
|
||||
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user