From 4270fa4b5393381e167afd840c60e89598293b29 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Mon, 26 Aug 2019 15:35:17 -0400 Subject: [PATCH] on complete join flow, take user to new project --- src/components/navigation/www/navigation.jsx | 1 + src/components/registration/scratch3-registration.jsx | 9 +++++++-- src/redux/navigation.js | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/navigation/www/navigation.jsx b/src/components/navigation/www/navigation.jsx index 7bc3ca663..90d34bcad 100644 --- a/src/components/navigation/www/navigation.jsx +++ b/src/components/navigation/www/navigation.jsx @@ -217,6 +217,7 @@ class Navigation extends React.Component { {this.props.registrationOpen && ( this.props.useScratch3Registration ? ( diff --git a/src/components/registration/scratch3-registration.jsx b/src/components/registration/scratch3-registration.jsx index 03f53d763..c345c168e 100644 --- a/src/components/registration/scratch3-registration.jsx +++ b/src/components/registration/scratch3-registration.jsx @@ -23,17 +23,22 @@ const Registration = ({ ); Registration.propTypes = { + createProjectOnComplete: PropTypes.bool, handleCloseRegistration: PropTypes.func, handleCompleteRegistration: PropTypes.func, isOpen: PropTypes.bool }; -const mapDispatchToProps = dispatch => ({ +Registration.defaultProps = { + createProjectOnComplete: false +}; + +const mapDispatchToProps = (dispatch, ownProps) => ({ handleCloseRegistration: () => { dispatch(navigationActions.setRegistrationOpen(false)); }, handleCompleteRegistration: () => { - dispatch(navigationActions.handleCompleteRegistration()); + dispatch(navigationActions.handleCompleteRegistration(ownProps.createProjectOnComplete)); } }); diff --git a/src/redux/navigation.js b/src/redux/navigation.js index 0e71090ae..957f9d4e7 100644 --- a/src/redux/navigation.js +++ b/src/redux/navigation.js @@ -92,9 +92,10 @@ module.exports.setSearchTerm = searchTerm => ({ searchTerm: searchTerm }); -module.exports.handleCompleteRegistration = () => (dispatch => { +module.exports.handleCompleteRegistration = createProject => (dispatch => { dispatch(sessionActions.refreshSession()); dispatch(module.exports.setRegistrationOpen(false)); + if (createProject) window.location = '/projects/editor/?tutorial=getStarted'; }); module.exports.handleLogIn = (formData, callback) => (dispatch => {