aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-10 02:06:22 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-10 02:06:22 +0800
commitdf91d343154bced69be86f7af4c4c702286cfd16 (patch)
tree35a540b849c38ce72a2b5bd5aedcc23f2b72ef6d /packages/instant/src/containers
parentd703c13f8eca7f7139581468e86cf6d2fa067c1e (diff)
parentb4a11de097258d37fa9271e64fc28a1d012a8d26 (diff)
downloaddexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar
dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.gz
dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.bz2
dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.lz
dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.xz
dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.tar.zst
dexon-sol-tools-df91d343154bced69be86f7af4c4c702286cfd16.zip
Merge branch 'development' into feature/instant/buy-quote-heartbeat
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts19
1 files changed, 5 insertions, 14 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 97fb073aa..74713327c 100644
--- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -12,6 +12,7 @@ import { State } from '../redux/reducer';
import { ColorOption } from '../style/theme';
import { AffiliateInfo, ERC20Asset, OrderProcessState } from '../types';
import { updateBuyQuoteOrFlashErrorAsync } from '../util/buy_quote_fetcher';
+import { buyQuoteUpdater } from '../util/buy_quote_updater';
export interface SelectedERC20AssetAmountInputProps {
fontColor?: ColorOption;
@@ -67,20 +68,10 @@ const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputP
};
};
-const updateBuyQuoteAsync = async (
- assetBuyer: AssetBuyer,
- dispatch: Dispatch<Action>,
- asset: ERC20Asset,
- assetAmount: BigNumber,
- affiliateInfo?: AffiliateInfo,
-): Promise<void> => {
- // mark quote as pending
- dispatch(actions.setQuoteRequestStatePending());
- // kick of buy quote
- updateBuyQuoteOrFlashErrorAsync(assetBuyer, asset, assetAmount, dispatch, affiliateInfo);
-};
-
-const debouncedUpdateBuyQuoteAsync = _.debounce(updateBuyQuoteAsync, 200, { trailing: true });
+// TODO: change to set pending to true
+const debouncedUpdateBuyQuoteAsync = _.debounce(buyQuoteUpdater.updateBuyQuoteAsync.bind(buyQuoteUpdater), 200, {
+ trailing: true,
+});
const mapDispatchToProps = (
dispatch: Dispatch<Action>,