From 60a62bb374ac9a5c333e5efa53b1496eea20e7b4 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 26 Jul 2016 15:24:51 -0400 Subject: [PATCH] Redirect to `/educators/classes` if a confirmed teacher Fixes #757. Note: Because we are getting this info from the session, the redirect may not happen until the page is rendered first in cases where the connection is slow, or the db is slow. --- src/components/registration/steps.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index bd956a8f5..59785f164 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -762,9 +762,16 @@ module.exports = { getDefaultProps: function () { return { email: null, - invited: false + invited: false, + confirmed: false, + educator: true }; }, + componentWillReceiveProps: function (nextProps) { + if (nextProps.educator && nextProps.confirmed) { + window.location.href = '/educators/classes/'; + } + }, render: function () { return (