diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-26 07:26:34 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-26 07:26:34 +0800 |
commit | c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb (patch) | |
tree | 34653ddbd6fa97eb522f827c0b488f91f3038595 /packages/website/ts/components/onboarding | |
parent | 53e2cda4c8d6698b5c4b69f510ad8764cb089306 (diff) | |
download | dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.tar dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.tar.gz dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.tar.bz2 dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.tar.lz dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.tar.xz dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.tar.zst dexon-sol-tools-c4e2dcafa4bd5f4b905680e2c1b80d6ddb6ab6fb.zip |
Have basic network switching working
Diffstat (limited to 'packages/website/ts/components/onboarding')
-rw-r--r-- | packages/website/ts/components/onboarding/portal_onboarding_flow.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx index 10d4af30e..35b51140d 100644 --- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx @@ -159,9 +159,11 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp const ethToken = utils.getEthToken(this.props.tokenByAddress); const zrxToken = utils.getZrxToken(this.props.tokenByAddress); if (ethToken && zrxToken) { - const ethTokenAllowance = this.props.trackedTokenStateByAddress[ethToken.address].allowance; - const zrxTokenAllowance = this.props.trackedTokenStateByAddress[zrxToken.address].allowance; - return ethTokenAllowance > new BigNumber(0) && zrxTokenAllowance > new BigNumber(0); + const ethTokenState = this.props.trackedTokenStateByAddress[ethToken.address]; + const zrxTokenState = this.props.trackedTokenStateByAddress[zrxToken.address]; + if (ethTokenState && zrxTokenState) { + return ethTokenState.allowance > new BigNumber(0) && zrxTokenState.allowance > new BigNumber(0); + } } return false; } @@ -222,6 +224,9 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp return null; } const tokenState = this.props.trackedTokenStateByAddress[token.address]; + if (!tokenState) { + return null; + } return ( <AllowanceToggle token={token} |