From a0db77bd868092db87aad0c0f50227b9b82a3336 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sat, 11 Feb 2023 09:43:30 +0100 Subject: [PATCH] Set default value for countriesOfSubscribers --- .../app/pages/landing/landing-page.component.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/client/src/app/pages/landing/landing-page.component.ts b/apps/client/src/app/pages/landing/landing-page.component.ts index 90cb8d813..e2ad8a592 100644 --- a/apps/client/src/app/pages/landing/landing-page.component.ts +++ b/apps/client/src/app/pages/landing/landing-page.component.ts @@ -52,15 +52,16 @@ export class LandingPageComponent implements OnDestroy, OnInit { private dataService: DataService, private deviceService: DeviceDetectorService ) { - const { countriesOfSubscribers, globalPermissions, statistics } = - this.dataService.fetchInfo(); + const { + countriesOfSubscribers = [], + globalPermissions, + statistics + } = this.dataService.fetchInfo(); - if (countriesOfSubscribers) { - for (const country of countriesOfSubscribers) { - this.countriesOfSubscribersMap[country] = { - value: 1 - }; - } + for (const country of countriesOfSubscribers) { + this.countriesOfSubscribersMap[country] = { + value: 1 + }; } this.hasPermissionForStatistics = hasPermission(