From 87fd48bf1d058687e8f876e5a4994f90b96b3d8b Mon Sep 17 00:00:00 2001 From: Johannes Herforth Date: Sat, 11 Feb 2023 01:45:10 +0100 Subject: [PATCH] fixed blank index page when self-hosting or developing - countriesOfSubscribers is undefined when the "ENABLE_FEATURE_SUBSCRIPTION" feature is not enabled in the info service --- CHANGELOG.md | 4 ++++ .../src/app/pages/landing/landing-page.component.ts | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7770a24a6..ed81a1ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded `chart.js` from version `4.0.1` to `4.2.0` - Upgraded `prettier` from version `2.8.1` to `2.8.4` +### Fixed + +- Fixed the Index page when self-hosting or developing for Ghostfolio + ## 1.233.0 - 2023-02-09 ### Added 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 f4a80c652..90cb8d813 100644 --- a/apps/client/src/app/pages/landing/landing-page.component.ts +++ b/apps/client/src/app/pages/landing/landing-page.component.ts @@ -55,10 +55,12 @@ export class LandingPageComponent implements OnDestroy, OnInit { const { countriesOfSubscribers, globalPermissions, statistics } = this.dataService.fetchInfo(); - for (const country of countriesOfSubscribers) { - this.countriesOfSubscribersMap[country] = { - value: 1 - }; + if (countriesOfSubscribers) { + for (const country of countriesOfSubscribers) { + this.countriesOfSubscribersMap[country] = { + value: 1 + }; + } } this.hasPermissionForStatistics = hasPermission(