aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux/reducer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/instant/src/redux/reducer.ts')
-rw-r--r--packages/instant/src/redux/reducer.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts
index 9bbd114a2..961e29619 100644
--- a/packages/instant/src/redux/reducer.ts
+++ b/packages/instant/src/redux/reducer.ts
@@ -67,12 +67,25 @@ export const createReducer = (initialState: State) => {
return reduceStateWithAccount(state, LOCKED_ACCOUNT);
case ActionTypes.SET_ACCOUNT_STATE_ERROR:
return reduceStateWithAccount(state, ERROR_ACCOUNT);
- case ActionTypes.SET_ACCOUNT_STATE_READY:
+ case ActionTypes.SET_ACCOUNT_STATE_READY: {
const account: AccountReady = {
state: AccountState.Ready,
address: action.data,
};
return reduceStateWithAccount(state, account);
+ }
+ case ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE: {
+ const account = state.providerState.account;
+ if (account.state !== AccountState.Ready) {
+ return state;
+ } else {
+ const newAccount: AccountReady = {
+ ...account,
+ ethBalanceInWei: action.data,
+ };
+ return reduceStateWithAccount(state, newAccount);
+ }
+ }
case ActionTypes.UPDATE_ETH_USD_PRICE:
return {
...state,