Browse Source

Set the change detection strategy to OnPush in the analysis page

pull/7275/head
Vyacheslav 7 days ago
parent
commit
a34e84614c
  1. 1
      CHANGELOG.md
  2. 6
      apps/client/src/app/pages/portfolio/analysis/analysis-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 analysis 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

6
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -25,6 +25,7 @@ import { GfValueComponent } from '@ghostfolio/ui/value';
import { Clipboard } from '@angular/cdk/clipboard'; import { Clipboard } from '@angular/cdk/clipboard';
import { import {
ChangeDetectionStrategy,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
computed, computed,
@ -51,6 +52,7 @@ import { DeviceDetectorService } from 'ngx-device-detector';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
GfBenchmarkComparatorComponent, GfBenchmarkComparatorComponent,
GfInvestmentChartComponent, GfInvestmentChartComponent,
@ -148,6 +150,8 @@ export class GfAnalysisPageComponent 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
@ -229,6 +233,8 @@ export class GfAnalysisPageComponent implements OnInit {
} else if (mode === 'portfolio') { } else if (mode === 'portfolio') {
this.isLoadingPortfolioPrompt = false; this.isLoadingPortfolioPrompt = false;
} }
this.changeDetectorRef.markForCheck();
}); });
} }

Loading…
Cancel
Save