aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-11 19:04:46 +0800
committerFabio Berger <me@fabioberger.com>2018-03-11 19:04:46 +0800
commit56a8e0a09a61ca2c399c676da695bf4cd4ed63a6 (patch)
tree0b2bb05f7101f6e27305dd8170f703e247cd8400 /packages/website/ts/components
parent4c08667a078ac9ca1ed5dc62d87a8cfe3b903741 (diff)
downloaddexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar
dexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.gz
dexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.bz2
dexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.lz
dexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.xz
dexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.zst
dexon-sol-tools-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.zip
Fix userAddress bugs
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/inputs/allowance_toggle.tsx1
-rw-r--r--packages/website/ts/components/portal.tsx3
2 files changed, 3 insertions, 1 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx
index 7fe303cf4..3d353d87c 100644
--- a/packages/website/ts/components/inputs/allowance_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_toggle.tsx
@@ -67,6 +67,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
private async _onToggleAllowanceAsync(): Promise<void> {
if (this.props.userAddress === '') {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
+ return;
}
this.setState({
diff --git a/packages/website/ts/components/portal.tsx b/packages/website/ts/components/portal.tsx
index ad437acdb..7df340f45 100644
--- a/packages/website/ts/components/portal.tsx
+++ b/packages/website/ts/components/portal.tsx
@@ -121,8 +121,9 @@ export class Portal extends React.Component<PortalAllProps, PortalAllState> {
});
}
if (nextProps.userAddress !== this.state.prevUserAddress) {
+ const newUserAddress = _.isEmpty(nextProps.userAddress) ? undefined : nextProps.userAddress;
// tslint:disable-next-line:no-floating-promises
- this._blockchain.userAddressUpdatedFireAndForgetAsync(nextProps.userAddress);
+ this._blockchain.userAddressUpdatedFireAndForgetAsync(newUserAddress);
this.setState({
prevUserAddress: nextProps.userAddress,
});