Set previous app version on persist store migration (#4296)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
parent
543a334977
commit
618d3ffe88
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import * as redux from 'redux';
|
|||
import {createPersistoid, createTransform, persistReducer, persistStore, Persistor, PersistConfig} from 'redux-persist';
|
||||
import {createBlacklistFilter} from 'redux-persist-transform-filter';
|
||||
import reduxReset from 'redux-reset';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
|
||||
import {General} from '@mm-redux/constants';
|
||||
import serviceReducer from '@mm-redux/reducers';
|
||||
|
|
@ -200,12 +201,20 @@ export default function configureStore(storage: any, preloadedState: any = {}, o
|
|||
|
||||
getStoredState().then(({storeKeys, restoredState}: V4Store) => {
|
||||
if (Object.keys(restoredState).length) {
|
||||
const {app} = restoredState;
|
||||
app.previousVersion = app.version;
|
||||
app.build = DeviceInfo.getBuildNumber();
|
||||
app.version = DeviceInfo.getVersion();
|
||||
|
||||
const state = {
|
||||
...restoredState,
|
||||
app: {
|
||||
...app,
|
||||
},
|
||||
views: {
|
||||
...restoredState.views,
|
||||
root: {
|
||||
hydrationComplete: true,
|
||||
hydrationComplete: false,
|
||||
},
|
||||
},
|
||||
_persist: persistor.getState(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue