Skip to content

Commit

Permalink
remove unnecessary loggingIn check when rendering authenticated and p…
Browse files Browse the repository at this point in the history
…ublic routes
  • Loading branch information
cleverbeagle committed Jul 9, 2017
1 parent 90e3a82 commit e763aeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ [email protected]
[email protected]
[email protected]
fortawesome:[email protected]
fourseven:[email protected].0
fourseven:[email protected].4
[email protected]
[email protected]
[email protected]
Expand Down Expand Up @@ -93,7 +93,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
themeteorchef:[email protected].2
themeteorchef:[email protected].3
tmeasday:[email protected]
[email protected]
twbs:[email protected]
Expand Down
9 changes: 4 additions & 5 deletions imports/ui/components/Authenticated/Authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { Route, Redirect } from 'react-router-dom';
const Authenticated = ({ loggingIn, authenticated, component, ...rest }) => (
<Route
{...rest}
render={(props) => {
if (loggingIn) return <div />;
return authenticated ?
render={props => (
authenticated ?
(React.createElement(component, { ...props, loggingIn, authenticated })) :
(<Redirect to="/logout" />);
}}
(<Redirect to="/logout" />)
)}
/>
);

Expand Down
9 changes: 4 additions & 5 deletions imports/ui/components/Public/Public.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { Route, Redirect } from 'react-router-dom';
const Public = ({ loggingIn, authenticated, component, ...rest }) => (
<Route
{...rest}
render={(props) => {
if (loggingIn) return <div />;
return !authenticated ?
render={props => (
!authenticated ?
(React.createElement(component, { ...props, loggingIn, authenticated })) :
(<Redirect to="/documents" />);
}}
(<Redirect to="/documents" />)
)}
/>
);

Expand Down

0 comments on commit e763aeb

Please sign in to comment.