aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-03 06:52:59 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-03 06:52:59 +0800
commit8c5dc7cecdb8766e68a1d70d007904eb62ac1c55 (patch)
tree08fda86f4f927f3f1f31da148ccb4e29ea0f2701 /packages/website/ts
parent300c9f09b9ee129791a1f62881da0ee3c34ee0b5 (diff)
downloaddexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.tar
dexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.tar.gz
dexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.tar.bz2
dexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.tar.lz
dexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.tar.xz
dexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.tar.zst
dexon-sol-tools-8c5dc7cecdb8766e68a1d70d007904eb62ac1c55.zip
Only auto-start onboarding if blockchain is loaded
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/components/onboarding/portal_onboarding_flow.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
index 6bfa5c75f..6d8007659 100644
--- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
@@ -46,7 +46,7 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
public componentDidMount(): void {
this._adjustStepIfShould();
// Wait until the step is adjusted to decide whether we should show onboarding.
- setTimeout(this._autoStartOnboardingIfShould.bind(this), 1000);
+ // setTimeout(this._autoStartOnboardingIfShould.bind(this), 1000);
// If there is a route change, just close onboarding.
this._unlisten = this.props.history.listen(() => this.props.updateIsRunning(false));
}
@@ -61,6 +61,9 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
document.querySelector('.wallet').scrollIntoView();
}
}
+ if (!prevProps.blockchainIsLoaded && this.props.blockchainIsLoaded) {
+ this._autoStartOnboardingIfShould();
+ }
}
public render(): React.ReactNode {
return (
@@ -221,7 +224,7 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
}
private _autoStartOnboardingIfShould(): void {
if (
- (this.props.stepIndex === 0 && !this.props.isRunning) ||
+ (this.props.stepIndex === 0 && !this.props.isRunning && this.props.blockchainIsLoaded) ||
(!this.props.isRunning && !this.props.hasBeenClosed && this.props.blockchainIsLoaded)
) {
const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId];