From 03df67b739fee9b1c06f4179c05f1ffea61d9f98 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 20 Mar 2024 08:27:52 +0100 Subject: [PATCH] MOBILE-4531 policy: Check if dataprivacy feature is disabled --- .../features/policy/pages/acceptances/acceptances.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/features/policy/pages/acceptances/acceptances.ts b/src/core/features/policy/pages/acceptances/acceptances.ts index 0212671ec..036091e0a 100644 --- a/src/core/features/policy/pages/acceptances/acceptances.ts +++ b/src/core/features/policy/pages/acceptances/acceptances.ts @@ -24,7 +24,7 @@ import { CorePolicyViewPolicyModalComponent } from '@features/policy/components/ import { CoreTime } from '@singletons/time'; import { CoreScreen } from '@services/screen'; import { Subscription } from 'rxjs'; -import { CORE_DATAPRIVACY_PAGE_NAME } from '@features/dataprivacy/constants'; +import { CORE_DATAPRIVACY_FEATURE_NAME, CORE_DATAPRIVACY_PAGE_NAME } from '@features/dataprivacy/constants'; import { CoreNavigator } from '@services/navigator'; import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy'; @@ -81,6 +81,13 @@ export class CorePolicyAcceptancesPage implements OnInit, OnDestroy { * Check if user can contact DPO. */ protected async fetchCanContactDPO(): Promise { + const site = CoreSites.getCurrentSite(); + if (!site || site.isFeatureDisabled(CORE_DATAPRIVACY_FEATURE_NAME)) { + this.canContactDPO = false; + + return; + } + this.canContactDPO = await CoreUtils.ignoreErrors(CoreDataPrivacy.isEnabled(), false); }