Skip to content

Commit

Permalink
chore(IT Wallet): [SIW-727] Reset wallet migration (#5290)
Browse files Browse the repository at this point in the history
## Short description
This PR resets the wallet state with a migration.

## How to test
Activate the wallet and obtain a credential from `bundle/it-wallet` then
switch to this branch. It should reset the state of the wallet.
  • Loading branch information
LazyAfternoons committed Dec 1, 2023
1 parent 1c43258 commit 6f853c0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ts/features/it-wallet/store/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ import itwPresentationReducer, {
} from "./new/itwPresentationReducer";
import itwIssuanceReducer, { ItwIssuanceState } from "./new/itwIssuanceReducer";

const CURRENT_REDUX_ITW_STORE_VERSION = 2;
const CURRENT_REDUX_ITW_STORE_VERSION = 3;

const itwStoreMigration: MigrationManifest = {
/**
* Version 2 where we reset the state due to redux state changes.
*/
"2": (): PersistedState => undefined as unknown as PersistedState
"2": (): PersistedState => undefined as unknown as PersistedState,
/**
* Version 3 where we reset the state due to redux state changes.
*/
"3": (): PersistedState => undefined as unknown as PersistedState
};

const CURRENT_REDUX_ITW_CREDENTIALS_STORE_VERSION = 2;
Expand All @@ -46,7 +50,11 @@ const itwCredentialsStoreMigration: MigrationManifest = {
/**
* Version 2 where we reset the state due to redux state changes.
*/
"2": (): PersistedState => undefined as unknown as PersistedState
"2": (): PersistedState => undefined as unknown as PersistedState,
/**
* Version 2 where we reset the state due to redux state changes.
*/
"3": (): PersistedState => undefined as unknown as PersistedState
};

export type ItWalletState = {
Expand Down

0 comments on commit 6f853c0

Please sign in to comment.