Skip to content

Commit

Permalink
[Missions] Corrige l'erreur de local storage suite au renommage de cl…
Browse files Browse the repository at this point in the history
…é des façade (#3244)

## Linked issues

- #2843

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
ivangabriele authored May 30, 2024
2 parents 37da601 + 3fb83af commit 07b7018
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions frontend/src/store/migrations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const MAIN_PERSISTOR_MISSION_MIGRATIONS = {
0: state => ({
...state,
listSeafrontGroup: state.listSeafrontGroup === 'ALL_SEAFRONT_GROUP' ? 'ALL' : state.listSeafrontGroup
})
}
6 changes: 5 additions & 1 deletion frontend/src/store/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { drawReducer } from '@features/Draw/slice'
import createMigrate from 'redux-persist/es/createMigrate'
import persistReducer from 'redux-persist/es/persistReducer'
import autoMergeLevel2 from 'redux-persist/es/stateReconciler/autoMergeLevel2'
import storage from 'redux-persist/es/storage' // LocalStorage

import { MAIN_PERSISTOR_MISSION_MIGRATIONS } from './migrations'
import { monitorenvApi, monitorfishApi, monitorfishLightApi, monitorfishPublicApi } from '../api/api'
import { beaconMalfunctionReducer } from '../domain/shared_slices/BeaconMalfunction'
import { controlReducer } from '../domain/shared_slices/Control'
Expand Down Expand Up @@ -91,7 +93,9 @@ export const mainReducer = {
...getCommonPersistReducerConfig<MissionListState>('mainPersistorMission', [
'listFilterValues',
'listSeafrontGroup'
])
]),
migrate: createMigrate(MAIN_PERSISTOR_MISSION_MIGRATIONS),
version: 0
},
missionListReducer
),
Expand Down

0 comments on commit 07b7018

Please sign in to comment.