Fix indicatator path undefiend in dashboard if subcategory is changed quickly.
This commit is contained in:
parent
a9a849a309
commit
cc788e95dc
|
@ -487,6 +487,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
this.subscriptions.push(this.statisticsService.getNumbers(this.statisticsService.getSourceType(pair[0]), pair[1]).subscribe(response => {
|
this.subscriptions.push(this.statisticsService.getNumbers(this.statisticsService.getSourceType(pair[0]), pair[1]).subscribe(response => {
|
||||||
if(activeSubcategory === this.activeSubCategory._id) {
|
if(activeSubcategory === this.activeSubCategory._id) {
|
||||||
indexes.forEach(([i, j]) => {
|
indexes.forEach(([i, j]) => {
|
||||||
|
if( this.activeSubCategory?.numbers[i]?.indicators[j]) {
|
||||||
let result = JSON.parse(JSON.stringify(response));
|
let result = JSON.parse(JSON.stringify(response));
|
||||||
this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => {
|
this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -502,6 +503,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
this.numberResults.set(i + '-' + j, result);
|
this.numberResults.set(i + '-' + j, result);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue