Skip to content
Snippets Groups Projects
Commit f60587ff authored by Chris Hines's avatar Chris Hines
Browse files

error initialising the apiserver the localstorage as a value null

parent 89e534eb
No related branches found
No related tags found
1 merge request!21New css dev
Pipeline #6948 passed
......@@ -59,7 +59,7 @@ export class AuthorisationService {
this.keys = [];
this.getSshAuthzServers();
this.keys = [];
this.backendSelectionService.apiserver.subscribe((value) => { this.backendURI = value.tes ; this.updateAgentContents() })
this.backendSelectionService.apiserver.subscribe((value) => { if (value != null) {this.backendURI = value.tes ; this.updateAgentContents()} })
this.agentContents.subscribe((value) => this.updateLoggedAuthZ());
this.sshAuthzServers.subscribe((value) => this.updateLoggedAuthZ());
}
......
......@@ -22,8 +22,13 @@ export class BackendSelectionService {
private initApiServer() {
try {
this.apiserver.next(<APIServer>JSON.parse(localStorage.getItem('apiserver')));
console.log('apiserver set to localstorage value',this.apiserver.value);
} catch {
this.apiserver.next(<APIServer>environment.apiserver);
console.log('api server to set environement',this.apiserver.value);
}
if (this.apiserver.value == null) {
this.apiserver.next(<APIServer>environment.apiserver);
}
}
......
......@@ -67,7 +67,7 @@ public apiservers: BehaviorSubject<APIServer[]>;
this.timerSubscription = null;
this.appwindowWatcher = null;
this.backendSelectionService.apiserver.subscribe( (value) => { this.twsproxy = value.tws ; this.Base = value.tes });
this.backendSelectionService.apiserver.subscribe( (value) => { if (value != null) {this.twsproxy = value.tws ; this.Base = value.tes }});
// this.batchinterface = {};
// this.computesitesService.identities.subscribe(identities => this.startPolling(identities));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment