From a9039ca63b73f55ee9b81fb91ec75899cd4a38ef Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 2 Aug 2016 10:52:47 -0400 Subject: [PATCH] Only redirect approved educators to My Classes Fixes #800 --- .../teacherwaitingroom/teacherwaitingroom.jsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/views/teacherwaitingroom/teacherwaitingroom.jsx b/src/views/teacherwaitingroom/teacherwaitingroom.jsx index 5770f55b3..94c0660b3 100644 --- a/src/views/teacherwaitingroom/teacherwaitingroom.jsx +++ b/src/views/teacherwaitingroom/teacherwaitingroom.jsx @@ -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 ( - + ); } }); 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 }; };