diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-10 02:06:22 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-10 02:06:22 +0800 |
commit | df91d343154bced69be86f7af4c4c702286cfd16 (patch) | |
tree | 35a540b849c38ce72a2b5bd5aedcc23f2b72ef6d /packages/instant/src/redux/reducer.ts | |
parent | d703c13f8eca7f7139581468e86cf6d2fa067c1e (diff) | |
parent | b4a11de097258d37fa9271e64fc28a1d012a8d26 (diff) | |
download | dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.gz dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.bz2 dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.lz dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.xz dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.zst dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.zip |
Merge branch 'development' into feature/instant/buy-quote-heartbeat
Diffstat (limited to 'packages/instant/src/redux/reducer.ts')
-rw-r--r-- | packages/instant/src/redux/reducer.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts index 961e29619..a5a1b6f7d 100644 --- a/packages/instant/src/redux/reducer.ts +++ b/packages/instant/src/redux/reducer.ts @@ -75,13 +75,14 @@ export const createReducer = (initialState: State) => { return reduceStateWithAccount(state, account); } case ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE: { - const account = state.providerState.account; - if (account.state !== AccountState.Ready) { + const { address, ethBalanceInWei } = action.data; + const currentAccount = state.providerState.account; + if (currentAccount.state !== AccountState.Ready || currentAccount.address !== address) { return state; } else { const newAccount: AccountReady = { - ...account, - ethBalanceInWei: action.data, + ...currentAccount, + ethBalanceInWei, }; return reduceStateWithAccount(state, newAccount); } |