Skip to content

Commit

Permalink
Merge branch 'master' into feature/support-ionq
Browse files Browse the repository at this point in the history
  • Loading branch information
salmma committed Aug 7, 2024
2 parents 17a396b + 5fbcfa1 commit 902f886
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import { environment } from '../../environments/environment';

export enum UiFeatures {
Expand Down Expand Up @@ -73,6 +73,11 @@ export class QcAtlasUiRepositoryConfigurationService {
this.configuration = initialValues;
this.parseNode(response.node, this.configuration);
return this.configuration;
}),
catchError((err) => {
this.configuration = initialValues;
console.warn('Could not load config from etcd store!', err);
return of(this.configuration);
})
);
}
Expand Down Expand Up @@ -102,7 +107,7 @@ export class QcAtlasUiRepositoryConfigurationService {
*/
private parseNode(node: EtcdNode, obj: QcAtlasUiConfiguration): void {
const slashIndex = node.key.lastIndexOf('/');
const key = node.key.substr(slashIndex + 1);
const key = node.key.substring(slashIndex + 1);
if (node.nodes) {
node.nodes.forEach((child) => this.parseNode(child, obj[key]));
} else {
Expand Down

0 comments on commit 902f886

Please sign in to comment.