Ensure that if max is selected in send flow, the correct value is set after network switch (#15444)

feature/default_network_editable
Dan J Miller 2 years ago
parent b6d587223b
commit d5b95d6e44
  1. 3
      ui/ducks/send/send.js
  2. 8
      ui/store/actions.js

@ -1565,6 +1565,9 @@ const slice = createSlice({
},
});
}
if (state.amountMode === AMOUNT_MODES.MAX) {
slice.caseReducers.updateAmountToMax(state);
}
slice.caseReducers.validateAmountField(state);
slice.caseReducers.validateGasField(state);
slice.caseReducers.validateSendState(state);

@ -1442,6 +1442,10 @@ export function updateMetamaskState(newState) {
},
});
}
dispatch({
type: actionConstants.UPDATE_METAMASK_STATE,
value: newState,
});
if (provider.chainId !== newProvider.chainId) {
dispatch({
type: actionConstants.CHAIN_CHANGED,
@ -1453,10 +1457,6 @@ export function updateMetamaskState(newState) {
// progress.
dispatch(initializeSendState({ chainHasChanged: true }));
}
dispatch({
type: actionConstants.UPDATE_METAMASK_STATE,
value: newState,
});
};
}

Loading…
Cancel
Save