call validateAddress only once per inputChange()

pull/479/head
slowbackspace 5 years ago
parent 8316661011
commit d9e03c898a

@ -141,12 +141,16 @@ const inputChange = (inputName: string, value: string): ThunkAction => (
type: SIGN_VERIFY.TOUCH, type: SIGN_VERIFY.TOUCH,
inputName, inputName,
}); });
if (inputName === 'verifyAddress' && validateAddress(value) !== null) {
dispatch({ if (inputName === 'verifyAddress') {
type: SIGN_VERIFY.ERROR, const error = validateAddress(value);
inputName, if (error) {
message: validateAddress(value), dispatch({
}); type: SIGN_VERIFY.ERROR,
inputName,
message: error,
});
}
} }
}; };

Loading…
Cancel
Save