Fix token amount bug

This commit is contained in:
fragosti 2019-04-22 18:21:32 -07:00
parent 2f72e15ea7
commit c687385974

View File

@ -57,10 +57,14 @@ export class ZeroExInstantProvider extends React.PureComponent<ZeroExInstantProv
networkId, networkId,
); );
let selectedAssetUnitAmount: BigNumber | undefined = new BigNumber(1); let selectedAssetUnitAmount: BigNumber | undefined;
if (selectedAsset !== undefined && selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20) { if (selectedAsset !== undefined) {
selectedAssetUnitAmount = if (selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20) {
props.defaultAssetBuyAmount === undefined ? undefined : new BigNumber(props.defaultAssetBuyAmount); selectedAssetUnitAmount =
props.defaultAssetBuyAmount === undefined ? undefined : new BigNumber(props.defaultAssetBuyAmount);
} else if (selectedAsset.metaData.assetProxyId === AssetProxyId.ERC721) {
selectedAssetUnitAmount = new BigNumber(1);
}
} }
// construct the final state // construct the final state