diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-05-23 06:18:22 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-05-25 01:52:11 +0800 |
commit | b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7 (patch) | |
tree | 951170665292c24f2bd3720ad21200185d7e2e54 /packages/website/ts/containers | |
parent | 7af77d3eb0a73a0bd27898f5d3842c7dc7afef77 (diff) | |
download | dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.tar dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.tar.gz dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.tar.bz2 dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.tar.lz dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.tar.xz dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.tar.zst dexon-sol-tools-b4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7.zip |
Fix issue where modal can be out of sync with app state
Diffstat (limited to 'packages/website/ts/containers')
-rw-r--r-- | packages/website/ts/containers/portal_onboarding_flow.ts | 16 |
1 files changed, 15 insertions, 1 deletions
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<PortalOnboardingFlowComponentProps> = connect(mapStateToProps)(PortalOnboardingFlowComponent); +const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({ + setOnboardingShowing: (isShowing: boolean): void => { + dispatch({ + type: ActionTypes.UpdatePortalOnboardingShowing, + data: isShowing, + }); + }, +}); + +export const PortalOnboardingFlow: React.ComponentClass<PortalOnboardingFlowComponentProps> = connect(mapStateToProps, mapDispatchToProps)(PortalOnboardingFlowComponent); |