mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Reverting tutorial fix (#6812)
This commit is contained in:
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|||||||
|
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
|
||||||
|
import {browserHistory} from 'react-router/es6';
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
import UserStore from 'stores/user_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 {loadProfilesForSidebar} from 'actions/user_actions.jsx';
|
||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
const TutorialSteps = Constants.TutorialSteps;
|
||||||
const Preferences = Constants.Preferences;
|
const Preferences = Constants.Preferences;
|
||||||
|
|
||||||
import AnnouncementBar from 'components/announcement_bar';
|
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() {
|
componentDidMount() {
|
||||||
TeamStore.addChangeListener(this.onTeamChanged);
|
TeamStore.addChangeListener(this.onTeamChanged);
|
||||||
PreferenceStore.addChangeListener(this.onPreferencesChanged);
|
PreferenceStore.addChangeListener(this.onPreferencesChanged);
|
||||||
|
|||||||
@@ -328,6 +328,18 @@ export default {
|
|||||||
(comarr) => callback(null, {team_sidebar: comarr[0].default, sidebar: comarr[1].default, center: comarr[2].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})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user