diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts index e0d8415ce..637fe8c31 100644 --- a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts +++ b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts @@ -108,17 +108,15 @@ export class GfUserDetailDialogComponent implements OnInit { } protected getSum() { - const prices = this.subscriptionsDataSource.data.reduce( - (acc, { price }) => { - if (price !== null) { - acc.push(new Big(price)); - } - - return acc; - }, - [] - ); - return getSum(prices).toNumber(); + return getSum( + this.subscriptionsDataSource.data + .filter(({ price }) => { + return price !== null; + }) + .map(({ price }) => { + return new Big(price); + }) + ).toNumber(); } protected getType({ createdAt, expiresAt, price }: Subscription) {