@@ -17,12 +17,13 @@ import type { MapViewerState, MapViewerSlice } from 'reducers/mapViewer';
17
17
import mapViewerReducer , { mapViewerInitialState , mapViewerSlice } from 'reducers/mapViewer' ;
18
18
import operationalStudiesConfReducer , {
19
19
operationalStudiesConfSlice ,
20
+ type OperationalStudiesConfState ,
20
21
} from 'reducers/osrdconf/operationalStudiesConf' ;
21
22
import stdcmConfReducer , {
22
23
stdcmConfInitialState ,
23
24
stdcmConfSlice ,
24
25
} from 'reducers/osrdconf/stdcmConf' ;
25
- import type { OsrdConfState , OsrdStdcmConfState } from 'reducers/osrdconf/types' ;
26
+ import type { OsrdStdcmConfState } from 'reducers/osrdconf/types' ;
26
27
import simulationReducer , {
27
28
simulationResultsInitialState ,
28
29
simulationResultsSlice ,
@@ -79,7 +80,7 @@ const operationalStudiesDateTransform = createTransform(
79
80
) ;
80
81
81
82
// Useful to only blacklist a sub-propertie of osrdconf
82
- const buildOsrdConfPersistConfig = < T extends OsrdConfState > (
83
+ const buildOsrdConfPersistConfig = < T extends OperationalStudiesConfState | OsrdStdcmConfState > (
83
84
slice : ConfSlice
84
85
) : PersistConfig < T > => ( {
85
86
key : slice . name ,
@@ -106,7 +107,7 @@ export interface RootState {
106
107
[ editorSlice . name ] : EditorState ;
107
108
[ mainSlice . name ] : MainState ;
108
109
[ stdcmConfSlice . name ] : OsrdStdcmConfState ;
109
- [ operationalStudiesConfSlice . name ] : OsrdConfState ;
110
+ [ operationalStudiesConfSlice . name ] : OperationalStudiesConfState ;
110
111
[ simulationResultsSlice . name ] : SimulationResultsState ;
111
112
[ osrdEditoastApi . reducerPath ] : ReturnType < typeof osrdEditoastApi . reducer > ;
112
113
[ osrdGatewayApi . reducerPath ] : ReturnType < typeof osrdGatewayApi . reducer > ;
@@ -132,7 +133,7 @@ export type AnyReducerState =
132
133
| EditorState
133
134
| MainState
134
135
| OsrdStdcmConfState
135
- | OsrdConfState
136
+ | OperationalStudiesConfState
136
137
| SimulationResultsState ;
137
138
138
139
export const rootReducer : ReducersMapObject < RootState > = {
@@ -146,9 +147,9 @@ export const rootReducer: ReducersMapObject<RootState> = {
146
147
stdcmConfReducer
147
148
) as unknown as Reducer < OsrdStdcmConfState , AnyAction > ,
148
149
[ operationalStudiesConfSlice . name ] : persistReducer (
149
- buildOsrdConfPersistConfig < OsrdConfState > ( operationalStudiesConfSlice ) ,
150
+ buildOsrdConfPersistConfig < OperationalStudiesConfState > ( operationalStudiesConfSlice ) ,
150
151
operationalStudiesConfReducer
151
- ) as unknown as Reducer < OsrdConfState , AnyAction > ,
152
+ ) as unknown as Reducer < OperationalStudiesConfState , AnyAction > ,
152
153
[ simulationResultsSlice . name ] : simulationReducer ,
153
154
[ osrdEditoastApi . reducerPath ] : osrdEditoastApi . reducer ,
154
155
[ osrdGatewayApi . reducerPath ] : osrdGatewayApi . reducer ,
0 commit comments