Formatting and removed old GA code

This commit is contained in:
Thomas Schmidt
2018-02-05 16:56:53 -08:00
parent 91a5bcf380
commit 83c7c8110d
2 changed files with 77 additions and 80 deletions

View File

@@ -75,22 +75,24 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS;
}
try {
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits)
.then(() => {
ReactGA.event({
category: 'Portal',
action: 'Set Allowance Success',
label: this.props.token.symbol,
value: newAllowanceAmountInBaseUnits.toNumber(),
});
}, () => {
ReactGA.event({
category: 'Portal',
action: 'Set Allowance Failure',
label: this.props.token.symbol,
value: newAllowanceAmountInBaseUnits.toNumber(),
});
});
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits).then(
() => {
ReactGA.event({
category: 'Portal',
action: 'Set Allowance Success',
label: this.props.token.symbol,
value: newAllowanceAmountInBaseUnits.toNumber(),
});
},
() => {
ReactGA.event({
category: 'Portal',
action: 'Set Allowance Failure',
label: this.props.token.symbol,
value: newAllowanceAmountInBaseUnits.toNumber(),
});
},
);
await this.props.refetchTokenStateAsync();
} catch (err) {
this.setState({