Commit 73564626 authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

Merge pull request #801 from rschamp/hotfix/waiting-room-loop

[Master] Only redirect approved educators to My Classes
parents 00c7dc92 a9039ca6
...@@ -11,27 +11,28 @@ require('./teacherwaitingroom.scss'); ...@@ -11,27 +11,28 @@ require('./teacherwaitingroom.scss');
var TeacherWaitingRoom = React.createClass({ var TeacherWaitingRoom = React.createClass({
displayName: 'TeacherWaitingRoom', displayName: 'TeacherWaitingRoom',
componentWillReceiveProps: function (nextProps) { componentWillReceiveProps: function (nextProps) {
if (nextProps.session.permissions.educator && nextProps.session.permissions.social) { if (nextProps.approved) {
window.location.href = '/educators/classes/'; window.location.href = '/educators/classes/';
} }
}, },
render: function () { render: function () {
var permissions = this.props.session.permissions || {};
var user = this.props.session.user || {};
return ( return (
<Deck className={classNames('teacher-waitingroom', this.props.className)}> <Deck className={classNames('teacher-waitingroom', this.props.className)}>
<TeacherApprovalStep confirmed={permissions.social} <TeacherApprovalStep {... this.props} />
invited={permissions.educator_invitee}
educator={permissions.educator}
email={user.email} />
</Deck> </Deck>
); );
} }
}); });
var mapStateToProps = function (state) { var mapStateToProps = function (state) {
var permissions = state.session.session.permissions || {};
var user = state.session.session.user || {};
return { return {
session: state.session.session approved: permissions && permissions.educator && !permissions.educator_invitee && permissions.social,
confirmed: permissions && permissions.social,
invited: permissions && permissions.educator_invitee,
educator: permissions && permissions.educator,
email: user && user.email
}; };
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment