From 356e0e368a6c2b759ce507e0af9855c5cf55e83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 12 Oct 2015 14:29:31 +0200 Subject: [PATCH] Fix some spelling errors in documentation --- js/components/ascribe_routes/proxy_route.js | 8 ++++---- .../proxy_routes/redirect_proxy_handler.js | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/js/components/ascribe_routes/proxy_route.js b/js/components/ascribe_routes/proxy_route.js index 196d0875..1e29de46 100644 --- a/js/components/ascribe_routes/proxy_route.js +++ b/js/components/ascribe_routes/proxy_route.js @@ -22,7 +22,7 @@ const ProxyRoute = React.createClass({ /** * Generally creating custom `Route`s is not supported by react-router. * - * However, if we take a look at how `Route`s are declared in the repo, + * However, if we take a look at how `Route`s are declared/generated in their github repo, * we see that it's fairly straight forward: * - https://github.com/rackt/react-router/blob/master/modules/Route.js#L21 * @@ -39,7 +39,7 @@ const ProxyRoute = React.createClass({ * - https://github.com/rackt/react-router/blob/master/modules/index.js#L19 * * Still there is a trick we can use to call this method manually. - * We call `createRoutes`: + * We call the public method `createRoutes`: * - (https://github.com/rackt/react-router/blob/master/modules/RouteUtils.js#L91) * which then calls `createRoutesFromReactChildren` * @@ -47,8 +47,8 @@ const ProxyRoute = React.createClass({ * `element.type.createRouteFromReactElement` is `true` or `false`. * * So what we can do is just simply set our element's `type.createRouteFromReactElement` - * to `false`, so that the if statement falls into the methods `else` case and calls - * `createRouteFromReactElement`: + * property to `false`, so that the if statement falls into the methods `else` case + * and calls `createRouteFromReactElement`: * - https://github.com/rackt/react-router/blob/master/modules/RouteUtils.js#L77 * * After returning from `createRoutes`, we set `element.type.createRouteFromReactElement` diff --git a/js/components/ascribe_routes/proxy_routes/redirect_proxy_handler.js b/js/components/ascribe_routes/proxy_routes/redirect_proxy_handler.js index aabfb991..055abb79 100644 --- a/js/components/ascribe_routes/proxy_routes/redirect_proxy_handler.js +++ b/js/components/ascribe_routes/proxy_routes/redirect_proxy_handler.js @@ -49,16 +49,16 @@ export default function RedirectProxyHandler({to, when}) { const { query } = this.props.location; const { redirectAuthenticated, redirect } = query; - // validate when as an enum, that is either 'loggedIn' or 'loggedOut'. + // validate `when` as an enum, that is either 'loggedIn' or 'loggedOut'. // Otherwise throw an error. if(when === 'loggedIn' || when === 'loggedOut') { - // The user of this Handler specifies with `when`, what kind of status + // The user of this handler specifies with `when`, what kind of status // needs to be checked to conditionally do - if that state is `true` - // a redirect. // - // So if when === 'loggedIn', we're checking if the user is logged in and - // vice versa. + // So if when === 'loggedIn', we're checking if the user is logged in (and + // vice versa) let exprToValidate = when === 'loggedIn' ? this.state.currentUser && this.state.currentUser.email : this.state.currentUser && !this.state.currentUser.email; @@ -68,13 +68,12 @@ export default function RedirectProxyHandler({to, when}) { window.setTimeout(() => this.history.pushState(null, to, query)); // Otherwise there can also be the case that the backend - // wants to redirect the user to a specific case when he's logged out already + // wants to redirect the user to a specific route when the user is logged out already } else if(!exprToValidate && when === 'loggedIn' && redirect) { delete query.redirect; window.setTimeout(() => this.history.pushState(null, '/' + redirect, query)); - // and when he's logged in already } else if(!exprToValidate && when === 'loggedOut' && redirectAuthenticated) { /* * redirectAuthenticated contains an arbirary path