From 5841324910de90fb98bd69f26d84ace4c7ab036d Mon Sep 17 00:00:00 2001 From: KBS Date: Wed, 8 Jul 2026 05:50:40 +0900 Subject: [PATCH] Task/set change detection strategy to OnPush in portfolio holdings page (#7264) * Set change detection strategy to OnPush * Update changelog --- CHANGELOG.md | 1 + .../components/home-holdings/home-holdings.component.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c111ac3c1..6c6137890 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Improved the user account deletion flow in the user settings of the user account 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 - Improved the language localization for Dutch (`nl`) diff --git a/apps/client/src/app/components/home-holdings/home-holdings.component.ts b/apps/client/src/app/components/home-holdings/home-holdings.component.ts index 661e21163..a789f3c66 100644 --- a/apps/client/src/app/components/home-holdings/home-holdings.component.ts +++ b/apps/client/src/app/components/home-holdings/home-holdings.component.ts @@ -15,6 +15,7 @@ import { GfToggleComponent } from '@ghostfolio/ui/toggle'; import { GfTreemapChartComponent } from '@ghostfolio/ui/treemap-chart'; import { + ChangeDetectionStrategy, ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, @@ -32,6 +33,7 @@ import { gridOutline, reorderFourOutline } from 'ionicons/icons'; import { DeviceDetectorService } from 'ngx-device-detector'; @Component({ + changeDetection: ChangeDetectionStrategy.OnPush, imports: [ FormsModule, GfHoldingsTableComponent, @@ -88,6 +90,8 @@ export class GfHomeHoldingsComponent implements OnInit { .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe((impersonationId) => { this.hasImpersonationId = !!impersonationId; + + this.changeDetectorRef.markForCheck(); }); this.userService.stateChanged @@ -107,9 +111,9 @@ export class GfHomeHoldingsComponent implements OnInit { ); this.initialize(); - - this.changeDetectorRef.markForCheck(); } + + this.changeDetectorRef.markForCheck(); }); this.viewModeFormControl.valueChanges