Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/set change detection strategy to OnPush in analysis page (#7275)

Вячеслав Дорошенкоb0747b025cca
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 88b32f0322..22406b5b1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the user account deletion flow in the user settings of the user account page
- Improved the date formatting of the first activity in the historical market data table of the admin control panel
- Set the change detection strategy to `OnPush` in the allocations page
+- Set the change detection strategy to `OnPush` in the analysis page
- Set the change detection strategy to `OnPush` in the portfolio holdings page
- Set the change detection strategy to `OnPush` in the _FIRE_ page
- Set the change detection strategy to `OnPush` in the users section of the admin control panel
diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
index 6c49a90302..ae41f54c88 100644
--- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
@@ -25,6 +25,7 @@ import { GfValueComponent } from '@ghostfolio/ui/value';
import { Clipboard } from '@angular/cdk/clipboard';
import {
+ ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
computed,
@@ -51,6 +52,7 @@ import { DeviceDetectorService } from 'ngx-device-detector';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({
+ changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
GfBenchmarkComparatorComponent,
GfInvestmentChartComponent,
@@ -148,6 +150,8 @@ export class GfAnalysisPageComponent implements OnInit {
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((impersonationId) => {
this.hasImpersonationId = !!impersonationId;
+
+ this.changeDetectorRef.markForCheck();
});
this.userService.stateChanged
@@ -167,6 +171,8 @@ export class GfAnalysisPageComponent implements OnInit {
this.update();
}
+
+ this.changeDetectorRef.markForCheck();
});
}
@@ -229,6 +235,8 @@ export class GfAnalysisPageComponent implements OnInit {
} else if (mode === 'portfolio') {
this.isLoadingPortfolioPrompt = false;
}
+
+ this.changeDetectorRef.markForCheck();
});
}
@@ -382,6 +390,7 @@ export class GfAnalysisPageComponent implements OnInit {
});
this.fetchDividendsAndInvestments();
+
this.changeDetectorRef.markForCheck();
}