Skip to content

Commit

Permalink
Reverting tutorial fix (mattermost#6812)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhulen committed Jul 1, 2017
1 parent 2ab50bc commit 1e58576
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/needs_team/needs_team.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions routes/route_team.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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})
);
}
}
]
}
Expand Down

0 comments on commit 1e58576

Please sign in to comment.