Merge pull request #3297 from LLK/revert-3296-revert-3295-join-flow-create-project

on complete join flow, take user to new project
This commit is contained in:
Benjamin Wheeler 2019-09-09 10:32:48 -04:00 committed by GitHub
commit 8431403322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View file

@ -217,6 +217,7 @@ class Navigation extends React.Component {
{this.props.registrationOpen && (
this.props.useScratch3Registration ? (
<Scratch3Registration
createProjectOnComplete
isOpen
key="scratch3registration"
/>

View file

@ -23,17 +23,19 @@ const Registration = ({
);
Registration.propTypes = {
// used in mapDispatchToProps; eslint doesn't understand that this prop is used
createProjectOnComplete: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
handleCloseRegistration: PropTypes.func,
handleCompleteRegistration: PropTypes.func,
isOpen: PropTypes.bool
};
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch, ownProps) => ({
handleCloseRegistration: () => {
dispatch(navigationActions.setRegistrationOpen(false));
},
handleCompleteRegistration: () => {
dispatch(navigationActions.handleCompleteRegistration());
dispatch(navigationActions.handleCompleteRegistration(ownProps.createProjectOnComplete));
}
});

View file

@ -92,9 +92,12 @@ module.exports.setSearchTerm = searchTerm => ({
searchTerm: searchTerm
});
module.exports.handleCompleteRegistration = () => (dispatch => {
dispatch(sessionActions.refreshSession());
dispatch(module.exports.setRegistrationOpen(false));
module.exports.handleCompleteRegistration = createProject => (dispatch => {
if (createProject) {
window.location = '/projects/editor/?tutorial=getStarted';
} else {
dispatch(module.exports.setRegistrationOpen(false));
}
});
module.exports.handleLogIn = (formData, callback) => (dispatch => {