Merge pull request #3150 from crazyserver/MOBILE-3968

MOBILE-3968 dashboard: Temp hack to remove forced myoverview MDL-72092
main
Dani Palou 2022-03-02 11:09:53 +01:00 committed by GitHub
commit 6b9de713f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,14 @@ export class CoreCoursesDashboardProvider {
}
const result = await site.read<CoreBlockGetDashboardBlocksWSResponse>('core_block_get_dashboard_blocks', params, preSets);
if (site.isVersionGreaterEqualThan('4.0')) {
// Temporary hack to have course overview on 3.9.5 but not on 4.0 onwards.
// To be removed in a near future.
// Remove myoverview when is forced. See MDL-72092.
result.blocks = result.blocks.filter((block) =>
block.instanceid != 0 || block.name != 'myoverview' || block.region != 'forced');
}
return result.blocks || [];
}