@symbolic/react-app
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@symbolic/react-app", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -11,10 +11,14 @@ import React from 'react'; //eslint-disable-line | ||
class SessionManager extends React.Component { | ||
componentDidMount() { | ||
var token = Cookies.get('sessionToken'); | ||
constructor(props) { | ||
super(props); | ||
if (token) this.props.logIn({token}); | ||
this.token = Cookies.get('sessionToken'); | ||
if (this.token) this.props.logIn({token: this.token}); | ||
} | ||
render() { | ||
return null; | ||
var isLoading = this.token !== undefined && this.props.session.isLoading !== false; | ||
console.log(this.props.session.isLoading) | ||
return isLoading ? null : this.props.children; | ||
} | ||
@@ -29,10 +33,11 @@ } | ||
<Provider store={this.props.store}> | ||
<SessionManager /> | ||
<BrowserRouter> | ||
<div className='sf-app-wrapper'> | ||
<Route component={Header}/> | ||
<div className='sf-content'> | ||
{this.props.children} | ||
<SessionManager> | ||
<div className='sf-app-wrapper'> | ||
<Route component={Header}/> | ||
<div className='sf-content'> | ||
{this.props.children} | ||
</div> | ||
</div> | ||
</div> | ||
</SessionManager> | ||
</BrowserRouter> | ||
@@ -39,0 +44,0 @@ </Provider> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10444
261