diff options
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 8 | ||||
-rw-r--r-- | packages/instant/src/util/buy_quote_updater.ts | 10 | ||||
-rw-r--r-- | packages/instant/src/util/heartbeater_factory.ts | 2 |
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); }; |