MOBILE-4531 policy: Check if dataprivacy feature is disabled

main
Dani Palou 2024-03-20 08:27:52 +01:00
parent 4ee9e4bc9a
commit 03df67b739
1 changed files with 8 additions and 1 deletions

View File

@ -24,7 +24,7 @@ import { CorePolicyViewPolicyModalComponent } from '@features/policy/components/
import { CoreTime } from '@singletons/time'; import { CoreTime } from '@singletons/time';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { Subscription } from 'rxjs'; 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 { CoreNavigator } from '@services/navigator';
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy'; import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
@ -81,6 +81,13 @@ export class CorePolicyAcceptancesPage implements OnInit, OnDestroy {
* Check if user can contact DPO. * Check if user can contact DPO.
*/ */
protected async fetchCanContactDPO(): Promise<void> { protected async fetchCanContactDPO(): Promise<void> {
const site = CoreSites.getCurrentSite();
if (!site || site.isFeatureDisabled(CORE_DATAPRIVACY_FEATURE_NAME)) {
this.canContactDPO = false;
return;
}
this.canContactDPO = await CoreUtils.ignoreErrors(CoreDataPrivacy.isEnabled(), false); this.canContactDPO = await CoreUtils.ignoreErrors(CoreDataPrivacy.isEnabled(), false);
} }