Browse Source

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

* Set change detection strategy to OnPush

* Update changelog
pull/7259/head
KBS 1 week ago
committed by GitHub
parent
commit
5841324910
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 8
      apps/client/src/app/components/home-holdings/home-holdings.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 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
- Improved the language localization for Dutch (`nl`) - Improved the language localization for Dutch (`nl`)

8
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 { GfTreemapChartComponent } from '@ghostfolio/ui/treemap-chart';
import { import {
ChangeDetectionStrategy,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
@ -32,6 +33,7 @@ import { gridOutline, reorderFourOutline } from 'ionicons/icons';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
FormsModule, FormsModule,
GfHoldingsTableComponent, GfHoldingsTableComponent,
@ -88,6 +90,8 @@ export class GfHomeHoldingsComponent 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
@ -107,9 +111,9 @@ export class GfHomeHoldingsComponent implements OnInit {
); );
this.initialize(); this.initialize();
this.changeDetectorRef.markForCheck();
} }
this.changeDetectorRef.markForCheck();
}); });
this.viewModeFormControl.valueChanges this.viewModeFormControl.valueChanges

Loading…
Cancel
Save