Skip to content

Commit

Permalink
register local fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sommerfe committed Sep 8, 2020
1 parent ebb1884 commit 0d38ef2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/Services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export class ApiService {
if (url && url !== 'undefined' && clientId && clientId !== 'undefined') {
this.urlReceived = true;
this.getBackendUrlEvent.emit();
this.local = localStorage.getItem('clientId') === localStorage.getItem('clientId_local')
return Promise.resolve(url);
} else {
return this.http.get<any>(window.location.origin + '/backendInfo', ApiService.getOptions()).toPromise().then((backendInfo) => {
Expand All @@ -182,6 +183,7 @@ export class ApiService {
localStorage.setItem('url_backend_local', backendInfo.url);
localStorage.setItem('url_backend_daisy', backendInfo.url_daisy);
localStorage.setItem('clientId_daisy', backendInfo.clientId_daisy);
this.local = false
this.getBackendUrlEvent.emit();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AppComponent implements OnInit {
if(!this.apiService.urlReceived) {
this.apiService.getBackendInfo()
}
this.apiService.local = localStorage.getItem('clientId') === localStorage.getItem('clientId_local')
//this.apiService.local = localStorage.getItem('clientId') === localStorage.getItem('clientId_local')
}

openTerms(){
Expand Down

0 comments on commit 0d38ef2

Please sign in to comment.