|
|
|
@ -83,7 +83,6 @@ export class GfAnalysisPageComponent implements OnInit { |
|
|
|
protected bottom3: PortfolioPosition[]; |
|
|
|
protected dividendsByGroup: InvestmentItem[]; |
|
|
|
protected readonly dividendTimelineDataLabel = $localize`Dividend`; |
|
|
|
protected hasImpersonationId: boolean; |
|
|
|
protected hasPermissionToReadAiPrompt: boolean; |
|
|
|
protected impersonationId: string | null; |
|
|
|
protected investments: InvestmentItem[]; |
|
|
|
@ -105,6 +104,7 @@ export class GfAnalysisPageComponent implements OnInit { |
|
|
|
protected performanceDataItemsInPercentage: HistoricalDataItem[]; |
|
|
|
protected readonly portfolioEvolutionDataLabel = $localize`Investment`; |
|
|
|
protected precision = 2; |
|
|
|
protected savingsRatePerMonth: number; |
|
|
|
protected streaks: PortfolioInvestmentsResponse['streaks']; |
|
|
|
protected top3: PortfolioPosition[]; |
|
|
|
protected unitCurrentStreak: string; |
|
|
|
@ -136,18 +136,13 @@ export class GfAnalysisPageComponent implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
get savingsRate() { |
|
|
|
const savingsRatePerMonth = |
|
|
|
this.hasImpersonationId || this.user.settings.isRestrictedView |
|
|
|
? undefined |
|
|
|
: this.user?.settings?.savingsRate; |
|
|
|
|
|
|
|
if (savingsRatePerMonth === undefined) { |
|
|
|
if (!this.savingsRatePerMonth) { |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
|
|
|
|
return this.mode() === 'year' |
|
|
|
? savingsRatePerMonth * 12 |
|
|
|
: savingsRatePerMonth; |
|
|
|
? this.savingsRatePerMonth * 12 |
|
|
|
: this.savingsRatePerMonth; |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
|
@ -155,7 +150,6 @@ export class GfAnalysisPageComponent implements OnInit { |
|
|
|
.onChangeHasImpersonation() |
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
.subscribe((impersonationId) => { |
|
|
|
this.hasImpersonationId = !!impersonationId; |
|
|
|
this.impersonationId = impersonationId; |
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
@ -282,8 +276,9 @@ export class GfAnalysisPageComponent implements OnInit { |
|
|
|
range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE |
|
|
|
}) |
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
.subscribe(({ investments, streaks }) => { |
|
|
|
.subscribe(({ investments, savingsRate, streaks }) => { |
|
|
|
this.investmentsByGroup = investments; |
|
|
|
this.savingsRatePerMonth = savingsRate; |
|
|
|
this.streaks = streaks; |
|
|
|
this.unitCurrentStreak = |
|
|
|
this.mode() === 'year' |
|
|
|
|