Browse Source

Task/set change detection strategy to OnPush in allocations page (#7274)

* Set the change detection strategy to OnPush

* Update changelog
pull/7275/head
Вячеслав Дорошенко 6 days ago
committed by GitHub
parent
commit
73d002f5c0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the user account deletion flow in the user settings of the user account page - Improved the user account deletion flow in the user settings of the user account page
- Set the change detection strategy to `OnPush` in the allocations page
- Set the change detection strategy to `OnPush` in the portfolio holdings 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 _FIRE_ page
- Set the change detection strategy to `OnPush` in the users section of the admin control panel - Set the change detection strategy to `OnPush` in the users section of the admin control panel

4
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -22,6 +22,7 @@ import { GfValueComponent } from '@ghostfolio/ui/value';
import { GfWorldMapChartComponent } from '@ghostfolio/ui/world-map-chart'; import { GfWorldMapChartComponent } from '@ghostfolio/ui/world-map-chart';
import { import {
ChangeDetectionStrategy,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
computed, computed,
@ -48,6 +49,7 @@ import { filter, switchMap, tap } from 'rxjs';
import { AllocationsPageParams } from './interfaces/interfaces'; import { AllocationsPageParams } from './interfaces/interfaces';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
GfPortfolioProportionChartComponent, GfPortfolioProportionChartComponent,
GfPremiumIndicatorComponent, GfPremiumIndicatorComponent,
@ -161,6 +163,8 @@ export class GfAllocationsPageComponent implements OnInit {
.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

Loading…
Cancel
Save