Don't query completed steps if not logged in

This commit is contained in:
Itay Mizeretz 2018-02-22 16:18:14 +02:00
parent 28ef2d8708
commit 9e169980e3
1 changed files with 16 additions and 14 deletions

View File

@ -26,6 +26,7 @@ let guardicoreLogoImage = require('../images/guardicore-logo.png');
class AppComponent extends AuthComponent { class AppComponent extends AuthComponent {
updateStatus = () => { updateStatus = () => {
if (this.auth.loggedIn()){
this.authFetch('/api') this.authFetch('/api')
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
@ -41,6 +42,7 @@ class AppComponent extends AuthComponent {
this.setState({completedSteps: res['completed_steps']}); this.setState({completedSteps: res['completed_steps']});
} }
}); });
}
}; };
renderRoute = (route_path, page_component, is_exact_path = false) => { renderRoute = (route_path, page_component, is_exact_path = false) => {