Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Migration fix (#1326)
Browse files Browse the repository at this point in the history
* migrate onboarded and initialized state

Signed-off-by: Aaron Sutula <[email protected]>

* Bump migration version

Signed-off-by: Aaron Sutula <[email protected]>
  • Loading branch information
asutula authored Aug 30, 2019
1 parent 61bde74 commit 0f622a8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions App/Redux/RootReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,22 +367,29 @@ const migrations: MigrationManifest = {
return rest
},
24: persistedState => {
// Move onboarded from preferences to initialization
const state = persistedState as any
const { onboarded, ...restPreferences } = state.preferences
const { initialized, ...restAccount } = state.account
return {
...state,
account: restAccount,
preferences: restPreferences
preferences: restPreferences,
initialization: {
onboarding: {
completed: onboarded
},
instance: {
state: 'initialized'
}
}
}
}
}

const persistConfig: PersistConfig = {
key: 'primary',
storage: AsyncStorage,
version: 23,
version: 24,
whitelist: [
'account',
'preferences',
Expand Down

0 comments on commit 0f622a8

Please sign in to comment.