Use balances.transferAll as available & applicable (#6399)

* Use balances.transferAll as available & applicable

* Adjust with only ?:
This commit is contained in:
Jaco 2021-10-24 19:17:04 +02:00 committed by GitHub
parent 26527e5b7e
commit c6e239b9f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,10 +213,18 @@ function Transfer ({ className = '', onClose, recipientId: propRecipientId, send
onStart={onClose}
params={
canToggleAll && isAll
? [propRecipientId || recipientId, maxTransfer]
? isFunction(api.tx.balances.transferAll)
? [propRecipientId || recipientId, false]
: [propRecipientId || recipientId, maxTransfer]
: [propRecipientId || recipientId, amount]
}
tx={(isProtected && api.tx.balances.transferKeepAlive) || api.tx.balances.transfer}
tx={
canToggleAll && isAll && isFunction(api.tx.balances.transferAll)
? api.tx.balances.transferAll
: isProtected
? api.tx.balances.transferKeepAlive
: api.tx.balances.transfer
}
/>
</Modal.Actions>
</Modal>