Skip to content

Commit e530af6

Browse files
authored
fix initialization of metric name store (#7)
1 parent 42b456a commit e530af6

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

dist/core/metric_names_store.js

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core/metric_names_store.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core/metric_names_store.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export class MetricNamesStore {
2828
public get(): Promise<string[]> {
2929
if (this.initialized) {
3030
return this.promiseUtils.resolvedPromise(this.metricNames);
31-
} else {
31+
} else if (this.fetchingPromise !== undefined) {
3232
return this.fetchingPromise;
33+
} else {
34+
return this.initialize();
3335
}
3436
}
3537

src/core/metric_names_store.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export class MetricNamesStore {
2828
public get(): Promise<string[]> {
2929
if (this.initialized) {
3030
return this.promiseUtils.resolvedPromise(this.metricNames);
31-
} else {
31+
} else if (this.fetchingPromise !== undefined) {
3232
return this.fetchingPromise;
33+
} else {
34+
return this.initialize();
3335
}
3436
}
3537

0 commit comments

Comments
 (0)