mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #801 from rschamp/hotfix/waiting-room-loop
[Master] Only redirect approved educators to My Classes
This commit is contained in:
commit
735646265d
1 changed files with 9 additions and 8 deletions
|
@ -11,27 +11,28 @@ require('./teacherwaitingroom.scss');
|
|||
var TeacherWaitingRoom = React.createClass({
|
||||
displayName: 'TeacherWaitingRoom',
|
||||
componentWillReceiveProps: function (nextProps) {
|
||||
if (nextProps.session.permissions.educator && nextProps.session.permissions.social) {
|
||||
if (nextProps.approved) {
|
||||
window.location.href = '/educators/classes/';
|
||||
}
|
||||
},
|
||||
render: function () {
|
||||
var permissions = this.props.session.permissions || {};
|
||||
var user = this.props.session.user || {};
|
||||
return (
|
||||
<Deck className={classNames('teacher-waitingroom', this.props.className)}>
|
||||
<TeacherApprovalStep confirmed={permissions.social}
|
||||
invited={permissions.educator_invitee}
|
||||
educator={permissions.educator}
|
||||
email={user.email} />
|
||||
<TeacherApprovalStep {... this.props} />
|
||||
</Deck>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var mapStateToProps = function (state) {
|
||||
var permissions = state.session.session.permissions || {};
|
||||
var user = state.session.session.user || {};
|
||||
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
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue