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 | |
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')
3 files changed, 13 insertions, 9 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} diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index 4166fde53..58acb435e 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -151,11 +151,11 @@ export class Portal extends React.Component<PortalProps, PortalState> { this.props.dispatcher.resetState(); } public componentDidUpdate(prevProps: PortalProps): void { - if (!prevProps.blockchainIsLoaded && this.props.blockchainIsLoaded) { - const trackedTokenAddresses = _.keys(this.state.trackedTokenStateByAddress); - // tslint:disable-next-line:no-floating-promises - this._fetchBalancesAndAllowancesAsync(trackedTokenAddresses); - } + // if (!prevProps.blockchainIsLoaded && this.props.blockchainIsLoaded) { + // const trackedTokenAddresses = _.keys(this.state.trackedTokenStateByAddress); + // // tslint:disable-next-line:no-floating-promises + // this._fetchBalancesAndAllowancesAsync(trackedTokenAddresses); + // } } public componentWillReceiveProps(nextProps: PortalProps): void { if (nextProps.networkId !== this.state.prevNetworkId) { diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index 537edc7bb..85578b116 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -58,7 +58,6 @@ const styles: Styles = { width: '100%', position: 'relative', top: 0, - zIndex: zIndex.topBar, paddingBottom: 1, }, bottomBar: { |