From 20d986df837a0f1b489767c413d6c112fd5f2c9c Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 7 Mar 2022 12:51:34 +0100 Subject: [PATCH] MOBILE-3967 course: Add config to always use legacy completion --- src/core/features/course/components/module/module.ts | 4 +++- src/types/config.d.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/features/course/components/module/module.ts b/src/core/features/course/components/module/module.ts index 5b34bd98d..29676e4ca 100644 --- a/src/core/features/course/components/module/module.ts +++ b/src/core/features/course/components/module/module.ts @@ -66,7 +66,9 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy { */ async ngOnInit(): Promise { this.modNameTranslated = CoreCourse.translateModuleName(this.module.modname) || ''; - this.showLegacyCompletion = this.showLegacyCompletion ?? !CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.11'); + this.showLegacyCompletion = this.showLegacyCompletion ?? + CoreConstants.CONFIG.uselegacycompletion ?? + !CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.11'); this.checkShowManualCompletion(); if (!this.module.handlerData) { diff --git a/src/types/config.d.ts b/src/types/config.d.ts index ef8c23349..ef01af18a 100644 --- a/src/types/config.d.ts +++ b/src/types/config.d.ts @@ -65,4 +65,5 @@ export interface EnvironmentConfig { wsrequestqueuedelay: number; // Maximum number of miliseconds to wait before processing the queue. calendarreminderdefaultvalue: number; // Initial value for default reminders (in seconds). User can change it later. removeaccountonlogout?: boolean; // True to remove the account when the user clicks logout. Doesn't affect switch account. + uselegacycompletion?: boolean; // Whether to use legacy completion by default in all course formats. }