Skip to content

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

Task/set change detection strategy to OnPush in portfolio holdings page (#7264)

KBS5841324910de
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c111ac3c1a..6c61378900 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 661e21163a..a789f3c66e 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