From b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 22 May 2018 15:18:22 -0700 Subject: Fix issue where modal can be out of sync with app state --- packages/website/ts/containers/portal_onboarding_flow.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'packages/website/ts/containers') diff --git a/packages/website/ts/containers/portal_onboarding_flow.ts b/packages/website/ts/containers/portal_onboarding_flow.ts index 46c23f62f..7e4b3ef39 100644 --- a/packages/website/ts/containers/portal_onboarding_flow.ts +++ b/packages/website/ts/containers/portal_onboarding_flow.ts @@ -1,6 +1,7 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; +import { ActionTypes } from 'ts/types'; import { PortalOnboardingFlow as PortalOnboardingFlowComponent, @@ -13,6 +14,10 @@ interface ConnectedState { isRunning: boolean; } +interface ConnectedDispatch { + setOnboardingShowing: (isShowing: boolean) => void; +} + const mapStateToProps = (state: State, ownProps: PortalOnboardingFlowComponentProps): ConnectedState => { return { stepIndex: state.portalOnboardingStep, @@ -20,4 +25,13 @@ const mapStateToProps = (state: State, ownProps: PortalOnboardingFlowComponentPr }; }; -export const PortalOnboardingFlow: React.ComponentClass = connect(mapStateToProps)(PortalOnboardingFlowComponent); +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + setOnboardingShowing: (isShowing: boolean): void => { + dispatch({ + type: ActionTypes.UpdatePortalOnboardingShowing, + data: isShowing, + }); + }, +}); + +export const PortalOnboardingFlow: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(PortalOnboardingFlowComponent); -- cgit v1.2.3