MOBILE-3814 courses: Always init prefetch course icons when not empty
parent
606f43b526
commit
8037168222
|
@ -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 = '';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue