diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-13 09:30:28 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-13 09:30:28 +0800 |
commit | 01b36b494996c641a3cb5bd3fd894624a8dad210 (patch) | |
tree | eb7ab9dc21faf515807f1be29839f6cc3580961d /packages/instant/src/redux/reducer.ts | |
parent | 711b307e6c56457647a98c6d76725aa90ac0d53e (diff) | |
download | dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.tar dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.gz dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.bz2 dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.lz dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.xz dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.zst dexon-sol-tools-01b36b494996c641a3cb5bd3fd894624a8dad210.zip |
fix: remove requirement of default case in all switch statements
Diffstat (limited to 'packages/instant/src/redux/reducer.ts')
-rw-r--r-- | packages/instant/src/redux/reducer.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts index 28f094184..3d7c3f483 100644 --- a/packages/instant/src/redux/reducer.ts +++ b/packages/instant/src/redux/reducer.ts @@ -74,13 +74,16 @@ export const createReducer = (initialState: State) => { return reduceStateWithAccount(state, LOCKED_ACCOUNT); case ActionTypes.SET_ACCOUNT_STATE_READY: { const address = action.data; - const newAccount: AccountReady = { + let newAccount: AccountReady = { state: AccountState.Ready, address, }; const currentAccount = state.providerState.account; if (currentAccount.state === AccountState.Ready && currentAccount.address === address) { - newAccount.ethBalanceInWei = currentAccount.ethBalanceInWei; + newAccount = { + ...newAccount, + ethBalanceInWei: currentAccount.ethBalanceInWei, + }; } return reduceStateWithAccount(state, newAccount); } |