aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
diff options
context:
space:
mode:
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.ts20
1 files changed, 9 insertions, 11 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 93ff3db70..2c2661e1a 100644
--- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -6,11 +6,11 @@ import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
-import { ERC20AssetAmountInput } from '../components/erc20_asset_amount_input';
+import { ERC20AssetAmountInput, ERC20AssetAmountInputProps } from '../components/erc20_asset_amount_input';
import { Action, actions } from '../redux/actions';
import { State } from '../redux/reducer';
import { ColorOption } from '../style/theme';
-import { AffiliateInfo, ERC20Asset, OrderProcessState } from '../types';
+import { AffiliateInfo, ERC20Asset, Omit, OrderProcessState } from '../types';
import { buyQuoteUpdater } from '../util/buy_quote_updater';
export interface SelectedERC20AssetAmountInputProps {
@@ -37,13 +37,7 @@ interface ConnectedDispatch {
) => void;
}
-interface ConnectedProps {
- value?: BigNumber;
- asset?: ERC20Asset;
- onChange: (value?: BigNumber, asset?: ERC20Asset) => void;
- isDisabled: boolean;
- numberOfAssetsAvailable?: number;
-}
+type ConnectedProps = Omit<ERC20AssetAmountInputProps, keyof SelectedERC20AssetAmountInputProps>;
type FinalProps = ConnectedProps & SelectedERC20AssetAmountInputProps;
@@ -59,7 +53,7 @@ const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputP
const assetBuyer = state.providerState.assetBuyer;
return {
assetBuyer,
- value: state.selectedAssetAmount,
+ value: state.selectedAssetUnitAmount,
asset: selectedAsset,
isDisabled,
numberOfAssetsAvailable,
@@ -87,7 +81,11 @@ const mapDispatchToProps = (
// even if it's debounced, give them the illusion it's loading
dispatch(actions.setQuoteRequestStatePending());
// tslint:disable-next-line:no-floating-promises
- debouncedUpdateBuyQuoteAsync(assetBuyer, dispatch, asset, value, true, affiliateInfo);
+ debouncedUpdateBuyQuoteAsync(assetBuyer, dispatch, asset, value, {
+ setPending: true,
+ dispatchErrors: true,
+ affiliateInfo,
+ });
}
},
});