diff --git a/src/core/classes/sites/site.ts b/src/core/classes/sites/site.ts index 2d386468f..005aad7d4 100644 --- a/src/core/classes/sites/site.ts +++ b/src/core/classes/sites/site.ts @@ -637,8 +637,8 @@ export class CoreSite extends CoreAuthenticatedSite { /** * @inheritdoc */ - protected getDisabledFeatures(): string | undefined { - return this.config ? this.getStoredConfig('tool_mobile_disabledfeatures') : super.getDisabledFeatures(); + protected getSiteDisabledFeatures(): string | undefined { + return this.config ? this.getStoredConfig('tool_mobile_disabledfeatures') : super.getSiteDisabledFeatures(); } /** diff --git a/src/core/classes/sites/unauthenticated-site.ts b/src/core/classes/sites/unauthenticated-site.ts index fc958b0e3..146fd029f 100644 --- a/src/core/classes/sites/unauthenticated-site.ts +++ b/src/core/classes/sites/unauthenticated-site.ts @@ -389,7 +389,22 @@ export class CoreUnauthenticatedSite { * * @returns Disabled features. */ - protected getDisabledFeatures(): string | undefined { + protected getDisabledFeatures(): string { + const siteDisabledFeatures = this.getSiteDisabledFeatures() || undefined; // If empty string, use undefined. + const appDisabledFeatures = CoreConstants.CONFIG.disabledFeatures; + + return [ + ...(siteDisabledFeatures?.split(',') || []), + ...(appDisabledFeatures?.split(',') || []), + ].join(','); + } + + /** + * Get disabled features string configured in the site. + * + * @returns Disabled features. + */ + protected getSiteDisabledFeatures(): string | undefined { return this.publicConfig?.tool_mobile_disabledfeatures; } diff --git a/src/types/config.d.ts b/src/types/config.d.ts index 569bfaa40..7c842146b 100644 --- a/src/types/config.d.ts +++ b/src/types/config.d.ts @@ -77,4 +77,5 @@ export interface EnvironmentConfig { hideInformativeLinks?: boolean; // Whether to hide informative links. iconsPrefixes?: Record>; // Prefixes for custom font icons (located in src/assets/fonts). clearIABSessionWhenAutoLogin?: 'android' | 'ios' | 'all'; // Clear the session every time a new IAB is opened with auto-login. + disabledFeatures?: string; // Disabled features for the whole app, using the same format as tool_mobile_disabledfeatures. }