Move to the view

thanks @rschamp!
This commit is contained in:
Matthew Taylor 2016-07-26 17:03:41 -04:00
parent 60a62bb374
commit 806fd25e46
2 changed files with 6 additions and 7 deletions

View file

@ -763,15 +763,9 @@ module.exports = {
return { return {
email: null, email: null,
invited: false, invited: false,
confirmed: false, confirmed: false
educator: true
}; };
}, },
componentWillReceiveProps: function (nextProps) {
if (nextProps.educator && nextProps.confirmed) {
window.location.href = '/educators/classes/';
}
},
render: function () { render: function () {
return ( return (
<Slide className="registration-step last-step"> <Slide className="registration-step last-step">

View file

@ -10,6 +10,11 @@ require('./teacherwaitingroom.scss');
var TeacherWaitingRoom = React.createClass({ var TeacherWaitingRoom = React.createClass({
displayName: 'TeacherWaitingRoom', displayName: 'TeacherWaitingRoom',
componentWillReceiveProps: function (nextProps) {
if (nextProps.session.permissions.educator && nextProps.session.permissions.social) {
window.location.href = '/educators/classes/';
}
},
render: function () { render: function () {
var permissions = this.props.session.permissions || {}; var permissions = this.props.session.permissions || {};
var user = this.props.session.user || {}; var user = this.props.session.user || {};