aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux/reducer.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-13 09:30:28 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-13 09:30:28 +0800
commit01b36b494996c641a3cb5bd3fd894624a8dad210 (patch)
treeeb7ab9dc21faf515807f1be29839f6cc3580961d /packages/instant/src/redux/reducer.ts
parent711b307e6c56457647a98c6d76725aa90ac0d53e (diff)
downloaddexon-0x-contracts-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.gz
dexon-0x-contracts-01b36b494996c641a3cb5bd3fd894624a8dad210.tar.zst
dexon-0x-contracts-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.ts7
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);
}