diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts index 9ef2ed9d7..01c0fb13f 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts @@ -148,9 +148,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { this.initialize(); - return this.dataService.fetchPortfolioDetails({ - filters: this.activeFilters - }); + return this.fetchPortfolioDetails(); }), takeUntil(this.unsubscribeSubject) ) @@ -210,6 +208,26 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { ? `{0}%` : `{0} ${this.user?.settings?.baseCurrency}`; + if (this.user?.settings?.isExperimentalFeatures === true) { + this.isLoading = true; + + this.initialize(); + + this.fetchPortfolioDetails() + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe((portfolioDetails) => { + this.initialize(); + + this.portfolioDetails = portfolioDetails; + + this.initializeAnalysisData(); + + this.isLoading = false; + + this.changeDetectorRef.markForCheck(); + }); + } + this.changeDetectorRef.markForCheck(); } }); @@ -561,6 +579,15 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { this.unsubscribeSubject.complete(); } + private fetchPortfolioDetails() { + return this.dataService.fetchPortfolioDetails({ + filters: + this.activeFilters.length > 0 + ? this.activeFilters + : this.userService.getFilters() + }); + } + private openAccountDetailDialog(aAccountId: string) { const dialogRef = this.dialog.open(AccountDetailDialog, { autoFocus: false, diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html index e082ca2b5..55a308dac 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html @@ -2,12 +2,14 @@

Allocations

+ @if (!user?.settings?.isExperimentalFeatures) { + }