MOBILE-3320 scorm: Fix file downloaded when it shouldn't
parent
1ac0b7a0f4
commit
997d6185fd
|
@ -15,7 +15,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { CoreError } from '@classes/errors/error';
|
||||
import { CoreCourseActivityPrefetchHandlerBase } from '@features/course/classes/activity-prefetch-handler';
|
||||
import { CoreCourseAnyModuleData, CoreCourseCommonModWSOptions } from '@features/course/services/course';
|
||||
import { CoreCourse, CoreCourseAnyModuleData, CoreCourseCommonModWSOptions } from '@features/course/services/course';
|
||||
import { CoreApp } from '@services/app';
|
||||
import { CoreFile } from '@services/file';
|
||||
import { CoreFilepool } from '@services/filepool';
|
||||
|
@ -316,8 +316,13 @@ export class AddonModScormPrefetchHandlerService extends CoreCourseActivityPrefe
|
|||
* @param siteId Site ID.
|
||||
* @returns Promise resolved with the SCORM.
|
||||
*/
|
||||
protected getScorm(module: CoreCourseAnyModuleData, courseId: number, siteId?: string): Promise<AddonModScormScorm> {
|
||||
const moduleUrl = 'url' in module ? module.url : undefined;
|
||||
protected async getScorm(module: CoreCourseAnyModuleData, courseId: number, siteId?: string): Promise<AddonModScormScorm> {
|
||||
let moduleUrl = 'url' in module ? module.url : undefined;
|
||||
if (!moduleUrl) {
|
||||
module = await CoreCourse.getModule(module.id, module.course, undefined, true, false, siteId);
|
||||
|
||||
moduleUrl = module.url;
|
||||
}
|
||||
|
||||
return AddonModScorm.getScorm(courseId, module.id, { moduleUrl, siteId });
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ export class AddonModScormSyncProvider extends CoreCourseActivitySyncBaseProvide
|
|||
if (updated) {
|
||||
try {
|
||||
// Update downloaded data.
|
||||
const module = await CoreCourse.getModuleBasicInfoByInstance(scorm.id, 'scorm', siteId);
|
||||
const module = await CoreCourse.getModule(scorm.coursemodule, scorm.course, undefined, false, false, siteId);
|
||||
|
||||
await this.prefetchAfterUpdate(AddonModScormPrefetchHandler.instance, module, scorm.course, undefined, siteId);
|
||||
} catch {
|
||||
|
|
Loading…
Reference in New Issue