MOBILE-3814 courses: Always init prefetch course icons when not empty

main
Pau Ferrer Ocaña 2022-03-15 14:26:40 +01:00
parent 606f43b526
commit 8037168222
1 changed files with 1 additions and 3 deletions

View File

@ -1064,15 +1064,13 @@ export class CoreCourseHelperProvider {
* *
* @param courses Courses array to get info from. * @param courses Courses array to get info from.
* @param prefetch Prefetch information. * @param prefetch Prefetch information.
* @param minCourses Min course to show icon.
* @return Resolved with the prefetch information updated when done. * @return Resolved with the prefetch information updated when done.
*/ */
async initPrefetchCoursesIcons( async initPrefetchCoursesIcons(
courses: CoreCourseBasicData[], courses: CoreCourseBasicData[],
prefetch: CorePrefetchStatusInfo, prefetch: CorePrefetchStatusInfo,
minCourses: number = 2,
): Promise<CorePrefetchStatusInfo> { ): Promise<CorePrefetchStatusInfo> {
if (!courses || courses.length < minCourses) { if (!courses || courses.length <= 0) {
// Not enough courses. // Not enough courses.
prefetch.icon = ''; prefetch.icon = '';