From b0747b025cca4b93231c6b17db2ff74161171c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=8F=D1=87=D0=B5=D1=81=D0=BB=D0=B0=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BE=D1=80=D0=BE=D1=88=D0=B5=D0=BD=D0=BA=D0=BE?= <44668361+SlavaDoroshenko@users.noreply.github.com> Date: Wed, 8 Jul 2026 22:12:54 +0300 Subject: [PATCH] Task/set change detection strategy to OnPush in analysis page (#7275) * Set change detection strategy to OnPush * Update changelog --- CHANGELOG.md | 1 + .../pages/portfolio/analysis/analysis-page.component.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88b32f032..22406b5b1 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 6c49a9030..ae41f54c8 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(); }