aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-01-29 00:45:20 +0800
committerFabio Berger <me@fabioberger.com>2018-01-29 00:45:20 +0800
commit005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1 (patch)
tree63aebaf67a71d8587e19a684c394c0ea91b48116 /packages/website/ts/components
parent6206ebc994a2cf76b90ac426218d6ed18b74a072 (diff)
downloaddexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.tar
dexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.tar.gz
dexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.tar.bz2
dexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.tar.lz
dexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.tar.xz
dexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.tar.zst
dexon-sol-tools-005a02efeb5ac874e1c1a4dd6679bfa3cc21b1b1.zip
Fix bug where could not switch to Ledger and back
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/inputs/token_amount_input.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/website/ts/components/inputs/token_amount_input.tsx b/packages/website/ts/components/inputs/token_amount_input.tsx
index f41d42d02..44f3fc4a8 100644
--- a/packages/website/ts/components/inputs/token_amount_input.tsx
+++ b/packages/website/ts/components/inputs/token_amount_input.tsx
@@ -41,7 +41,7 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
}
public componentWillMount() {
// tslint:disable-next-line:no-floating-promises
- this._fetchBalanceAndAllowanceAsync(this.props.token.address);
+ this._fetchBalanceAndAllowanceAsync(this.props.token.address, this.props.userAddress);
}
public componentWillReceiveProps(nextProps: TokenAmountInputProps) {
if (
@@ -50,7 +50,7 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
nextProps.token.address !== this.props.token.address ||
nextProps.lastForceTokenStateRefetch !== this.props.lastForceTokenStateRefetch
) {
- this._fetchBalanceAndAllowanceAsync(nextProps.token.address);
+ this._fetchBalanceAndAllowanceAsync(nextProps.token.address, nextProps.userAddress);
}
}
public render() {
@@ -99,12 +99,12 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
return undefined;
}
}
- private async _fetchBalanceAndAllowanceAsync(tokenAddress: string) {
+ private async _fetchBalanceAndAllowanceAsync(tokenAddress: string, userAddress: string) {
this.setState({
isBalanceAndAllowanceLoaded: false,
});
const [balance, allowance] = await this.props.blockchain.getTokenBalanceAndAllowanceAsync(
- this.props.userAddress,
+ userAddress,
tokenAddress,
);
this.setState({