From 9d80a62bb18296c34824048b8ea2be5ad9b3515d Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Mon, 5 Feb 2018 18:02:05 -0800 Subject: Moved to async await --- .../ts/components/inputs/allowance_toggle.tsx | 31 +++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'packages/website/ts/components/inputs') diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index 7d41d9633..0a42df71b 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -75,26 +75,21 @@ export class AllowanceToggle extends React.Component { - 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) + ReactGA.event({ + category: 'Portal', + action: 'Set Allowance Success', + label: this.props.token.symbol, + value: newAllowanceAmountInBaseUnits.toNumber(), + }); await this.props.refetchTokenStateAsync(); } catch (err) { + ReactGA.event({ + category: 'Portal', + action: 'Set Allowance Failure', + label: this.props.token.symbol, + value: newAllowanceAmountInBaseUnits.toNumber(), + }); this.setState({ isSpinnerVisible: false, }); -- cgit