aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/inputs
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-02-07 08:25:50 +0800
committerFabio Berger <me@fabioberger.com>2018-02-07 08:25:50 +0800
commitc172b9e0800dd9ed959b03e7ee418b9787c70c38 (patch)
tree29ec60d527c2cd341ea650e0ae87e8afbd90ef55 /packages/website/ts/components/inputs
parent5533a84dcda251509fdf771ea37678a3be2fac6d (diff)
downloaddexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.tar
dexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.tar.gz
dexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.tar.bz2
dexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.tar.lz
dexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.tar.xz
dexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.tar.zst
dexon-sol-tools-c172b9e0800dd9ed959b03e7ee418b9787c70c38.zip
Add networkId to event label
Diffstat (limited to 'packages/website/ts/components/inputs')
-rw-r--r--packages/website/ts/components/inputs/allowance_toggle.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx
index a737222ca..a2e75dfed 100644
--- a/packages/website/ts/components/inputs/allowance_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_toggle.tsx
@@ -6,12 +6,14 @@ import * as ReactGA from 'react-ga';
import { Blockchain } from 'ts/blockchain';
import { Dispatcher } from 'ts/redux/dispatcher';
import { BalanceErrs, Token, TokenState } from 'ts/types';
+import { constants } from 'ts/utils/constants';
import { errorReporter } from 'ts/utils/error_reporter';
import { utils } from 'ts/utils/utils';
const DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS = new BigNumber(2).pow(256).minus(1);
interface AllowanceToggleProps {
+ networkId: number;
blockchain: Blockchain;
dispatcher: Dispatcher;
onErrorOccurred: (errType: BalanceErrs) => void;
@@ -74,12 +76,14 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
if (!this._isAllowanceSet()) {
newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS;
}
+ const networkName = constants.NETWORK_NAME_BY_ID[this.props.networkId];
+ const eventLabel = `${this.props.token.symbol}-${networkName}`;
try {
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits);
ReactGA.event({
category: 'Portal',
action: 'Set Allowance Success',
- label: this.props.token.symbol,
+ label: eventLabel,
value: newAllowanceAmountInBaseUnits.toNumber(),
});
await this.props.refetchTokenStateAsync();
@@ -87,7 +91,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
ReactGA.event({
category: 'Portal',
action: 'Set Allowance Failure',
- label: this.props.token.symbol,
+ label: eventLabel,
value: newAllowanceAmountInBaseUnits.toNumber(),
});
this.setState({