Skip to content

Commit

Permalink
fix additional calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzmind committed Jun 14, 2024
1 parent b13c634 commit 6551067
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/overview/overview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ export class OverviewComponent implements OnInit {
// "__typename": "ExpStatistics"
// }
private _fixStatistics() {
this.experiencesRaw = this.experiencesRaw.map(exp => {
this.experiencesRaw = this.experiencesRaw.map(exp => this._doStatisticsFix(exp));
}

private _doStatisticsFix(exp: Experience) {
{
//console.log('fixing statistics', exp.statistics);
if (!exp.statistics) {
exp.statistics = {} as Statistics;
Expand Down Expand Up @@ -306,9 +310,8 @@ export class OverviewComponent implements OnInit {

//console.log('fixed statistics', exp.statistics);
return exp; // Return the modified experience
});
}
}

private _filterByTag() {
const activeTags = this.tags.filter(t => t.active).map(t => t.name);
if (!activeTags.length) {
Expand Down Expand Up @@ -452,6 +455,7 @@ export class OverviewComponent implements OnInit {
return;
}
res.forEach(exp => {
exp = this._doStatisticsFix(exp);
// update both experiencesRaw and experiences
const expRawIndex = this.experiencesRaw.findIndex(e => e.uuid === exp.uuid);
if (expRawIndex >= 0 && !this.utils.isEqual(this.experiencesRaw[expRawIndex].statistics, exp.statistics)) {
Expand Down

0 comments on commit 6551067

Please sign in to comment.