From de975a59912576b62bbba5993d26dbcd8d794662 Mon Sep 17 00:00:00 2001 From: David Requeno <108202767+DavidReque@users.noreply.github.com> Date: Mon, 13 Jul 2026 01:39:16 -0600 Subject: [PATCH] Task/set change detection strategy to OnPush in X-ray page (#7313) * Set change detection strategy to OnPush * Update changelog --- CHANGELOG.md | 6 ++++++ .../pages/portfolio/x-ray/x-ray-page.component.ts | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e6752795..83146cce0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Set the change detection strategy to `OnPush` in the _X-ray_ page + ## 3.25.0 - 2026-07-12 ### Changed diff --git a/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts b/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts index c5c4fc979..6e162e11f 100644 --- a/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts +++ b/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts @@ -12,7 +12,12 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; import { DataService } from '@ghostfolio/ui/services'; -import { ChangeDetectorRef, Component, DestroyRef } from '@angular/core'; +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + DestroyRef +} from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { IonIcon } from '@ionic/angular/standalone'; import { addIcons } from 'ionicons'; @@ -24,6 +29,7 @@ import { import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; @Component({ + changeDetection: ChangeDetectionStrategy.OnPush, imports: [ GfPremiumIndicatorComponent, GfRulesComponent, @@ -63,6 +69,8 @@ export class GfXRayPageComponent { .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe((impersonationId) => { this.hasImpersonationId = !!impersonationId; + + this.changeDetectorRef.markForCheck(); }); this.userService.stateChanged @@ -103,6 +111,8 @@ export class GfXRayPageComponent { private initializePortfolioReport() { this.isLoading = true; + this.changeDetectorRef.markForCheck(); + this.dataService .fetchPortfolioReport() .pipe(takeUntilDestroyed(this.destroyRef))