1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 10:48:22 +00:00

call validateAddress only once per inputChange()

This commit is contained in:
slowbackspace 2019-03-29 09:47:05 +01:00
parent 8316661011
commit d9e03c898a

View File

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