Skip to content

Commit

Permalink
fix(IT Wallet): [SIW-2003] Fix redux migration logic (#6728)
Browse files Browse the repository at this point in the history
## Short description
This PR fixes a redux migration issue, using now a different logic

## List of changes proposed in this pull request
- Redux migration fix

## How to test
Try to update from a previous version and verify that any error occurs.
  • Loading branch information
ale-mazz authored Feb 18, 2025
1 parent 5f92407 commit f2db628
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ts/features/itwallet/common/store/reducers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as O from "fp-ts/lib/Option";
import AsyncStorage from "@react-native-async-storage/async-storage";
import _ from "lodash";
import { combineReducers } from "redux";
Expand Down Expand Up @@ -57,10 +56,9 @@ const migrations: MigrationManifest = {

// Added authLevel to preferences store and set it to "L2" if eid is present
"2": (state: PersistedState): PersistedState => {
const { credentials, preferences } = state as PersistedItWalletState;

// If eid is a Some(value), set authLevel to "L2"
if (O.isSome(credentials.eid)) {
const { lifecycle, preferences } = state as PersistedItWalletState;
// If the lifecycle is valid that means we have an eid, set the authLevel to "L2"
if (lifecycle === ItwLifecycleState.ITW_LIFECYCLE_VALID) {
return {
...state,
preferences: {
Expand Down

0 comments on commit f2db628

Please sign in to comment.