Reverting tutorial fix (#6812)

This commit is contained in:
Corey Hulen
2017-06-30 18:18:04 -07:00
committed by GitHub
parent d2eb10b7e6
commit 093dfd6c7f
2 changed files with 22 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
import $ from 'jquery';
import {browserHistory} from 'react-router/es6';
import * as Utils from 'utils/utils.jsx';
import TeamStore from 'stores/team_store.jsx';
import UserStore from 'stores/user_store.jsx';
@@ -17,6 +18,7 @@ import {startPeriodicSync, stopPeriodicSync} from 'actions/websocket_actions.jsx
import {loadProfilesForSidebar} from 'actions/user_actions.jsx';
import Constants from 'utils/constants.jsx';
const TutorialSteps = Constants.TutorialSteps;
const Preferences = Constants.Preferences;
import AnnouncementBar from 'components/announcement_bar';
@@ -100,6 +102,14 @@ export default class NeedsTeam extends React.Component {
}
}
componentWillMount() {
// Go to tutorial if we are first arriving
const tutorialStep = PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 999);
if (tutorialStep <= TutorialSteps.INTRO_SCREENS) {
browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/tutorial');
}
}
componentDidMount() {
TeamStore.addChangeListener(this.onTeamChanged);
PreferenceStore.addChangeListener(this.onPreferencesChanged);

View File

@@ -328,6 +328,18 @@ export default {
(comarr) => callback(null, {team_sidebar: comarr[0].default, sidebar: comarr[1].default, center: comarr[2].default})
);
}
},
{
path: 'tutorial',
getComponents: (location, callback) => {
Promise.all([
System.import('components/team_sidebar'),
System.import('components/sidebar.jsx'),
System.import('components/tutorial/tutorial_view.jsx')
]).then(
(comarr) => callback(null, {team_sidebar: comarr[0].default, sidebar: comarr[1].default, center: comarr[2].default})
);
}
}
]
}