diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-11 19:33:34 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-11 19:33:34 +0800 |
commit | caaa70f6302b0d84d43ca93ab014e0cf37886c0a (patch) | |
tree | 21967186c45a0e84a0ed54d3aeffa7596aad3be0 /packages/website/ts/components/generate_order | |
parent | 56a8e0a09a61ca2c399c676da695bf4cd4ed63a6 (diff) | |
download | dexon-sol-tools-caaa70f6302b0d84d43ca93ab014e0cf37886c0a.tar.gz dexon-sol-tools-caaa70f6302b0d84d43ca93ab014e0cf37886c0a.tar.zst dexon-sol-tools-caaa70f6302b0d84d43ca93ab014e0cf37886c0a.zip |
Fix getTokenBalanceAndAllowanceAsync to take ownerAddressIfExists so that we don't sometimes pass an empty string and sometimes undefined
Diffstat (limited to 'packages/website/ts/components/generate_order')
-rw-r--r-- | packages/website/ts/components/generate_order/generate_order_form.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx index 26fa904fe..ea1d57a7b 100644 --- a/packages/website/ts/components/generate_order/generate_order_form.tsx +++ b/packages/website/ts/components/generate_order/generate_order_form.tsx @@ -237,8 +237,9 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G // Check if all required inputs were supplied const debitToken = this.props.sideToAssetToken[Side.Deposit]; + const userAddressIfExists = _.isEmpty(this.props.userAddress) ? undefined : this.props.userAddress; const [debitBalance, debitAllowance] = await this.props.blockchain.getTokenBalanceAndAllowanceAsync( - this.props.userAddress, + userAddressIfExists, debitToken.address, ); const receiveAmount = this.props.sideToAssetToken[Side.Receive].amount; |