diff --git a/package.json b/package.json index df1255f7..ae223455 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "private": true, "scripts": { - "android": "react-native run-android", + "android": "adb reverse tcp:8081 tcp:8081 && react-native run-android", "ios": "react-native run-ios", "start": "react-native start --reset-cache", "postinstall": "npx react-native link react-native-randombytes && ./node_modules/.bin/rn-nodeify --hack --install", diff --git a/src/reducers/wallet.js b/src/reducers/wallet.js index 616f110f..3e75b04f 100644 --- a/src/reducers/wallet.js +++ b/src/reducers/wallet.js @@ -14,6 +14,7 @@ const initialState = { publicKey: null, privateKey: null, walletPirvateKey: null, + walletPath: null, }; function reducer(state = initialState, action) { diff --git a/src/sagas/wallet.js b/src/sagas/wallet.js index 778ef461..82228d90 100644 --- a/src/sagas/wallet.js +++ b/src/sagas/wallet.js @@ -56,9 +56,13 @@ export function* initWallet() { } export function* createInitialWallet(action) { - const { payload } = yield take(REHYDRATE); + // Take two as we have two different persisted stores + const { payload: payload1 } = yield take(REHYDRATE); + const { payload: payload2 } = yield take(REHYDRATE); + const payload = { ...payload1, ...payload2 }; + try { - if (payload?.wallet && !payload.wallet.address) { + if (!payload?.wallet?.address) { const password = ''; let mnemonic = new Mnemonic(); while (!Mnemonic.isValid(mnemonic.toString())) { @@ -89,12 +93,14 @@ export function* createInitialWallet(action) { createInitialWalletSuccess({ password, address, + addressPath, walletWif, addressWif, xPrivKey, publicKey, privateKey, walletPirvateKey, + walletPath, seedWords: mnemonic.phrase, }), );