Skip to content

Commit db38f99

Browse files
committed
persist-migrate: Make some small cleanups.
1 parent 863bca7 commit db38f99

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/redux-persist-migrate/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ export default function createMigration(manifest, versionSelector, versionSetter
4949
const migrationDispatch = next => action => {
5050
if (action.type === REHYDRATE) {
5151
const incomingState = action.payload;
52-
let incomingVersion = parseInt(versionSelector(incomingState), 10);
52+
const incomingVersion = parseInt(versionSelector(incomingState), 10);
5353
if (Number.isNaN(incomingVersion)) {
54-
incomingVersion = null;
55-
// first launch after install, so initial state is empty object
56-
// migration not required, just update verion
54+
// first launch after install, so incoming state is empty object
55+
// migration not required, just update version
5756
action.payload = versionSetter(incomingState, currentVersion);
5857
return next(action);
5958
}

0 commit comments

Comments
 (0)