Browse Source

Task/set change detection strategy to OnPush in X-ray page (#7313)

* Set change detection strategy to OnPush

* Update changelog
pull/6751/merge
David Requeno 2 days ago
committed by GitHub
parent
commit
de975a5991
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 12
      apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts

6
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/), 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). 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 ## 3.25.0 - 2026-07-12
### Changed ### Changed

12
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 { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator';
import { DataService } from '@ghostfolio/ui/services'; 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 { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { IonIcon } from '@ionic/angular/standalone'; import { IonIcon } from '@ionic/angular/standalone';
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
@ -24,6 +29,7 @@ import {
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
GfPremiumIndicatorComponent, GfPremiumIndicatorComponent,
GfRulesComponent, GfRulesComponent,
@ -63,6 +69,8 @@ export class GfXRayPageComponent {
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((impersonationId) => { .subscribe((impersonationId) => {
this.hasImpersonationId = !!impersonationId; this.hasImpersonationId = !!impersonationId;
this.changeDetectorRef.markForCheck();
}); });
this.userService.stateChanged this.userService.stateChanged
@ -103,6 +111,8 @@ export class GfXRayPageComponent {
private initializePortfolioReport() { private initializePortfolioReport() {
this.isLoading = true; this.isLoading = true;
this.changeDetectorRef.markForCheck();
this.dataService this.dataService
.fetchPortfolioReport() .fetchPortfolioReport()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))

Loading…
Cancel
Save