aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-05-23 06:18:22 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-05-25 01:52:11 +0800
commitb4e1ce59f9d5500667228f4ab1a2c9c4ca087ca7 (patch)
tree951170665292c24f2bd3720ad21200185d7e2e54 /packages/website/ts/containers
parent7af77d3eb0a73a0bd27898f5d3842c7dc7afef77 (diff)
downloaddexon-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.ts16
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);