diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 19:39:37 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 19:43:50 +0800 |
commit | e34b0af25133629ad4c177c4d7d5050bd6ac19b8 (patch) | |
tree | 936eae17521984e5ccc28057973461e707322326 /packages/website/ts/components/inputs | |
parent | fa7237fde7acea32c5492f0dcdef4d55b3ade6e1 (diff) | |
download | dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.gz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.bz2 dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.lz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.xz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.zst dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.zip |
Fix ts error in portal after enabling more strict checks
Diffstat (limited to 'packages/website/ts/components/inputs')
-rw-r--r-- | packages/website/ts/components/inputs/allowance_toggle.tsx | 7 | ||||
-rw-r--r-- | packages/website/ts/components/inputs/token_amount_input.tsx | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index b29511390..1be441e17 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -47,7 +47,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow <Toggle disabled={this.state.isSpinnerVisible} toggled={this._isAllowanceSet()} - onToggle={this._onToggleAllowanceAsync.bind(this, this.props.token)} + onToggle={this._onToggleAllowanceAsync.bind(this)} /> </div> {this.state.isSpinnerVisible && ( @@ -58,10 +58,9 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow </div> ); } - private async _onToggleAllowanceAsync() { + private async _onToggleAllowanceAsync(): Promise<void> { if (this.props.userAddress === '') { this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true); - return false; } this.setState({ @@ -80,7 +79,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow }); const errMsg = '' + err; if (_.includes(errMsg, 'User denied transaction')) { - return false; + return; } utils.consoleLog(`Unexpected error encountered: ${err}`); utils.consoleLog(err.stack); diff --git a/packages/website/ts/components/inputs/token_amount_input.tsx b/packages/website/ts/components/inputs/token_amount_input.tsx index f3f522ce3..63966d759 100644 --- a/packages/website/ts/components/inputs/token_amount_input.tsx +++ b/packages/website/ts/components/inputs/token_amount_input.tsx @@ -63,6 +63,8 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok </Link> </span> ); + } else { + return undefined; } } } |