Skip to content
Snippets Groups Projects
Commit c64a59f6 authored by Loïc Poullain's avatar Loïc Poullain
Browse files

Remove casTypes with bad format

parent a386af1c
No related branches found
No related tags found
1 merge request!120Use new cas type format (request and redux state)
......@@ -29,6 +29,19 @@ const makeApplicationState = (initialState) => {
if (process.env.NODE_ENV === "development") {
enhancer = composeWithDevTools(enhancer);
}
if (
nextState.descriptions &&
nextState.descriptions.ir &&
nextState.descriptions.ir.casTypes &&
nextState.descriptions.ir.casTypes.length > 0 &&
nextState.descriptions.ir.casTypes[0].hasOwnProperty('revenusNetMensuel')
) {
// State stored in cookie uses an old format.
nextState.descriptions.ir.casTypes = [];
}
console.log(JSON.stringify(nextState.descriptions, null, 2))
const store = createStore(reducers, nextState, enhancer);
return store;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment