Fix undefined for maxValue validator in case there is no token selected

This commit is contained in:
Agustin Pane 2020-06-16 09:29:12 -03:00
parent 6d1a349d87
commit 336413c8e5
1 changed files with 2 additions and 1 deletions

View File

@ -220,11 +220,12 @@ const SendFunds = ({ initialValues, onClose, onNext, recipientAddress, selectedT
placeholder="Amount*"
text="Amount*"
type="text"
disabled={!selectedTokenRecord}
validate={composeValidators(
required,
mustBeFloat,
greaterThan(0),
maxValue(selectedTokenRecord && selectedTokenRecord.balance),
maxValue(selectedTokenRecord?.balance),
)}
/>
<OnChange name="token">