From 8f2deada26f38514aa5cf84c713a4f36708c3cc1 Mon Sep 17 00:00:00 2001 From: Sasha Date: Wed, 13 Apr 2022 10:29:42 +0300 Subject: [PATCH] fix --- .../shared/components/workshop-card/workshop-card.component.ts | 2 +- .../personal-cabinet/cabinet-data/cabinet-data.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/shared/components/workshop-card/workshop-card.component.ts b/src/app/shared/components/workshop-card/workshop-card.component.ts index 447f0bf12a..3cc4a55c22 100644 --- a/src/app/shared/components/workshop-card/workshop-card.component.ts +++ b/src/app/shared/components/workshop-card/workshop-card.component.ts @@ -46,7 +46,7 @@ export class WorkshopCardComponent implements OnInit, OnDestroy { @Input() icons: {}; @Input() set pendingApplications(applications: Application[]) { if (applications?.length) { - applications.filter((application: Application) => { + this.pendingApplicationAmount = applications.filter((application: Application) => { return (application.workshopId === this.workshopData.workshopId && application.status === ApplicationStatus.Pending); }).length; } else { diff --git a/src/app/shell/personal-cabinet/cabinet-data/cabinet-data.component.ts b/src/app/shell/personal-cabinet/cabinet-data/cabinet-data.component.ts index 4aaf2e646e..3070eeea89 100644 --- a/src/app/shell/personal-cabinet/cabinet-data/cabinet-data.component.ts +++ b/src/app/shell/personal-cabinet/cabinet-data/cabinet-data.component.ts @@ -81,6 +81,7 @@ export abstract class CabinetDataComponent implements OnInit, OnDestroy { }); this.applications$.pipe( + filter((applications: Application[]) => !!applications), takeUntil(this.destroy$) ).subscribe((applications: Application[]) => this.applications = applications); }