Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(common/components/addons/RouteAuth): add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Metnew committed Aug 4, 2017
1 parent 481944e commit 4f54e9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/components/addons/RouteAuth/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RouteAuth extends Component {
componentWillMount () {
const {lazy, component} = this.props
if (lazy) {
console.log('Component is lazy, loading...')
this.load()
} else {
this.setState({componentLoaded: true, componentToRender: component})
Expand All @@ -49,6 +50,9 @@ class RouteAuth extends Component {
component: componentToRender || null
}

console.log(`User has access to "${path}" path: ${canAccess(path) ? 'YES' : 'NO'}`)
console.log(`Route's component loaded and ready to be mounted: ${componentLoaded ? 'YES' : 'NO'}`)

if (componentLoaded) {
return canAccess(path)
? <Route {...routeProps} />
Expand Down

0 comments on commit 4f54e9e

Please sign in to comment.