summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-06-30 18:18:04 -0700
committerGitHub <noreply@github.com>2017-06-30 18:18:04 -0700
commit093dfd6c7fe893d6ab8981b917a87bd563eb58a3 (patch)
treec185fc9921f5bf34b3894848ab256bca30ce7865 /webapp
parentd2eb10b7e66213d43e00551170e77acc220c0ef8 (diff)
downloadchat-093dfd6c7fe893d6ab8981b917a87bd563eb58a3.tar.gz
chat-093dfd6c7fe893d6ab8981b917a87bd563eb58a3.tar.bz2
chat-093dfd6c7fe893d6ab8981b917a87bd563eb58a3.zip
Reverting tutorial fix (#6812)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/needs_team/needs_team.jsx10
-rw-r--r--webapp/routes/route_team.jsx12
2 files changed, 22 insertions, 0 deletions
diff --git a/webapp/components/needs_team/needs_team.jsx b/webapp/components/needs_team/needs_team.jsx
index ba3200b43..e86e4fb11 100644
--- a/webapp/components/needs_team/needs_team.jsx
+++ b/webapp/components/needs_team/needs_team.jsx
@@ -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);
diff --git a/webapp/routes/route_team.jsx b/webapp/routes/route_team.jsx
index 69dd517a0..59cf6d673 100644
--- a/webapp/routes/route_team.jsx
+++ b/webapp/routes/route_team.jsx
@@ -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})
+ );
+ }
}
]
}