Skip to content

Commit

Permalink
Should reset redux storage when wallet is restarted (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
Freshenext authored Sep 27, 2023
1 parent 7843a37 commit 82546fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/redux/slices/settingsSlice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
ChainTypesByIdType,
} from 'shared/constants/chainConstants'
import { getCurrentChainId } from 'storage/ChainStorage'
import { resetReduxStorage } from 'storage/ReduxStorage'

import {
Bitcoin,
Expand Down Expand Up @@ -271,6 +272,7 @@ export const resetApp = createAsyncThunk(
thunkAPI.dispatch(setPinState(null))
thunkAPI.dispatch(setKeysExist(false))
resetMainStorage()
resetReduxStorage()
return 'deleted'
} catch (err) {
return thunkAPI.rejectWithValue(err)
Expand Down
2 changes: 2 additions & 0 deletions src/storage/ReduxStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ export const reduxStorage: (chainId: number) => Storage = (
return Promise.resolve()
},
})*/

export const resetReduxStorage = () => storage.deleteAll()
11 changes: 1 addition & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2023,16 +2023,7 @@
lodash "^4.17.15"
randombytes "^2.1.0"

"@rsksmart/rif-relay-light-sdk@*", "@rsksmart/[email protected]":
version "1.0.10"
resolved "https://npm.pkg.github.com/download/@rsksmart/rif-relay-light-sdk/1.0.10/1ec76ecd23747dde0bebd66651ec0b7327ae08d7#1ec76ecd23747dde0bebd66651ec0b7327ae08d7"
integrity sha512-RrTI5UH0EF8xMmtlwxlX1fVjQkkC+ROY/PPTcTdY8B81LxzT/bFE7xDZJBH1ob94MJ5Jd1btu4LHiG6PGpfY7g==
dependencies:
"@ethersproject/abstract-provider" "^5.7.0"
axios "^1.2.3"
ethers "^5.7.2"

"@rsksmart/rif-relay-light-sdk@^1.0.11":
"@rsksmart/rif-relay-light-sdk@*", "@rsksmart/[email protected]", "@rsksmart/rif-relay-light-sdk@^1.0.11":
version "1.0.11"
resolved "https://npm.pkg.github.com/download/@rsksmart/rif-relay-light-sdk/1.0.11/4b1f889bd9c32eb77932a1ddf357a1b46415094f#4b1f889bd9c32eb77932a1ddf357a1b46415094f"
integrity sha512-GXIlGzKhaV/aIbxPihyXj38nlQow9Q/9kDgXW/yl8gNUAd5iAm0fOp8/GOzdNAUVDqqc2YbPq10nHjX1BNXQEA==
Expand Down

0 comments on commit 82546fc

Please sign in to comment.