diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-09 03:04:16 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-09 03:04:16 +0800 |
commit | c27194a35783d966b27deeb1654a077b8c1ba1c8 (patch) | |
tree | 2b1deb57dcddf1c52bb7155836971be52d0b9fa3 /packages/instant/src/containers/selected_erc20_asset_amount_input.ts | |
parent | 6d5f65b77ede962b96ca59f30df1679a8216bd06 (diff) | |
parent | adcfe51190c8ca5cd4d11e49eb7e100c80fbd16c (diff) | |
download | dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.gz dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.bz2 dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.lz dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.xz dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.zst dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/prevent-css-leakage
Diffstat (limited to 'packages/instant/src/containers/selected_erc20_asset_amount_input.ts')
-rw-r--r-- | packages/instant/src/containers/selected_erc20_asset_amount_input.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts index f7d56c564..784eb4bd0 100644 --- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts +++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts @@ -23,7 +23,7 @@ export interface SelectedERC20AssetAmountInputProps { } interface ConnectedState { - assetBuyer?: AssetBuyer; + assetBuyer: AssetBuyer; value?: BigNumber; asset?: ERC20Asset; isDisabled: boolean; @@ -33,7 +33,7 @@ interface ConnectedState { interface ConnectedDispatch { updateBuyQuote: ( - assetBuyer?: AssetBuyer, + assetBuyer: AssetBuyer, value?: BigNumber, asset?: ERC20Asset, affiliateInfo?: AffiliateInfo, @@ -52,15 +52,16 @@ type FinalProps = ConnectedProps & SelectedERC20AssetAmountInputProps; const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputProps): ConnectedState => { const processState = state.buyOrderState.processState; - const isEnabled = processState === OrderProcessState.NONE || processState === OrderProcessState.FAILURE; + const isEnabled = processState === OrderProcessState.None || processState === OrderProcessState.Failure; const isDisabled = !isEnabled; const selectedAsset = !_.isUndefined(state.selectedAsset) && state.selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20 ? (state.selectedAsset as ERC20Asset) : undefined; const numberOfAssetsAvailable = _.isUndefined(state.availableAssets) ? undefined : state.availableAssets.length; + const assetBuyer = state.providerState.assetBuyer; return { - assetBuyer: state.assetBuyer, + assetBuyer, value: state.selectedAssetAmount, asset: selectedAsset, isDisabled, @@ -128,7 +129,7 @@ const mapDispatchToProps = ( // reset our buy state dispatch(actions.setBuyOrderStateNone()); - if (!_.isUndefined(value) && value.greaterThan(0) && !_.isUndefined(asset) && !_.isUndefined(assetBuyer)) { + if (!_.isUndefined(value) && value.greaterThan(0) && !_.isUndefined(asset)) { // even if it's debounced, give them the illusion it's loading dispatch(actions.setQuoteRequestStatePending()); // tslint:disable-next-line:no-floating-promises |