aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-29 06:11:53 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-29 06:11:53 +0800
commitec01893e9c987fcbd3fd7bcb4ec34498a6f516cc (patch)
treeaf7714c79643c1bbf51a2c8ac19277205ef4e310 /packages/instant/src/util
parentf4cc14f43862c639d2cf9f6e5359e4822f1bcacf (diff)
downloaddexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.gz
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.bz2
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.lz
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.xz
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.zst
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.zip
fetchedVia -> fetchOrigin
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r--packages/instant/src/util/analytics.ts8
-rw-r--r--packages/instant/src/util/buy_quote_updater.ts10
-rw-r--r--packages/instant/src/util/heartbeater_factory.ts2
3 files changed, 12 insertions, 8 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index c0ed8c638..99e8736d3 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -180,16 +180,16 @@ export const analytics = {
trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload),
trackTokenSelectorSearched: (searchText: string) =>
trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }),
- trackQuoteFetched: (buyQuote: BuyQuote, fetchedVia: QuoteFetchOrigin) =>
+ trackQuoteFetched: (buyQuote: BuyQuote, fetchOrigin: QuoteFetchOrigin) =>
trackingEventFnWithPayload(EventNames.QUOTE_FETCHED)({
...buyQuoteEventProperties(buyQuote),
- fetchedVia,
+ fetchOrigin,
}),
- trackQuoteError: (errorMessage: string, assetAmount: BigNumber, fetchedVia: QuoteFetchOrigin) => {
+ trackQuoteError: (errorMessage: string, assetAmount: BigNumber, fetchOrigin: QuoteFetchOrigin) => {
trackingEventFnWithPayload(EventNames.QUOTE_ERROR)({
errorMessage,
assetAmount: assetAmount.toString(),
- fetchedVia,
+ fetchOrigin,
});
},
};
diff --git a/packages/instant/src/util/buy_quote_updater.ts b/packages/instant/src/util/buy_quote_updater.ts
index 14af57660..06474b69f 100644
--- a/packages/instant/src/util/buy_quote_updater.ts
+++ b/packages/instant/src/util/buy_quote_updater.ts
@@ -20,7 +20,7 @@ export const buyQuoteUpdater = {
options: {
setPending: boolean;
dispatchErrors: boolean;
- fetchedVia: QuoteFetchOrigin;
+ fetchOrigin: QuoteFetchOrigin;
affiliateInfo?: AffiliateInfo;
},
): Promise<void> => {
@@ -37,7 +37,11 @@ export const buyQuoteUpdater = {
} catch (error) {
if (options.dispatchErrors) {
dispatch(actions.setQuoteRequestStateFailure());
- analytics.trackQuoteError(error.message ? error.message : 'other', assetUnitAmount, options.fetchedVia);
+ analytics.trackQuoteError(
+ error.message ? error.message : 'other',
+ assetUnitAmount,
+ options.fetchOrigin,
+ );
let errorMessage;
if (error.message === AssetBuyerError.InsufficientAssetLiquidity) {
const assetName = assetUtils.bestNameForAsset(asset, 'of this asset');
@@ -65,6 +69,6 @@ export const buyQuoteUpdater = {
errorFlasher.clearError(dispatch);
// invalidate the last buy quote.
dispatch(actions.updateLatestBuyQuote(newBuyQuote));
- analytics.trackQuoteFetched(newBuyQuote, options.fetchedVia);
+ analytics.trackQuoteFetched(newBuyQuote, options.fetchOrigin);
},
};
diff --git a/packages/instant/src/util/heartbeater_factory.ts b/packages/instant/src/util/heartbeater_factory.ts
index 84aeb4dbc..5f7ef55e5 100644
--- a/packages/instant/src/util/heartbeater_factory.ts
+++ b/packages/instant/src/util/heartbeater_factory.ts
@@ -20,7 +20,7 @@ export const generateBuyQuoteHeartbeater = (options: HeartbeatFactoryOptions): H
return new Heartbeater(async () => {
await asyncData.fetchCurrentBuyQuoteAndDispatchToStore(store.getState(), store.dispatch, {
updateSilently: true,
- fetchedVia: QuoteFetchOrigin.Heartbeat,
+ fetchOrigin: QuoteFetchOrigin.Heartbeat,
});
}, shouldPerformImmediatelyOnStart);
};