App: Wait for user active session before checking permission
This commit is contained in:
parent
43e87a184d
commit
971399aaeb
1 changed files with 6 additions and 8 deletions
14
src/App.js
14
src/App.js
|
|
@ -13,7 +13,7 @@ class App extends Component {
|
|||
super();
|
||||
|
||||
this.state = {
|
||||
permission: true,
|
||||
permission: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -23,14 +23,12 @@ class App extends Component {
|
|||
this.appNav = insights.chrome.on('APP_NAVIGATION', event => this.props.history.push(`/${event.navId}`));
|
||||
insights.chrome.auth.getUser().then(data => {
|
||||
this.setState({ identity: data.identity });
|
||||
api.getVersion().then(() => {
|
||||
this.setState({ permission: true });
|
||||
}).catch(() => {
|
||||
this.setState({ permission: false });
|
||||
});
|
||||
});
|
||||
|
||||
api.getVersion().then(() => {
|
||||
this.setState({ permission: true });
|
||||
}).catch(() => {
|
||||
this.setState({ permission: false });
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue