forked from CIT/Vmeda.Online
		
	MOBILE-2913 course: Fix section progress when an error happens
This commit is contained in:
		
							parent
							
								
									900c9b741e
								
							
						
					
					
						commit
						f5f04b35c1
					
				| @ -101,6 +101,6 @@ | ||||
|         <!-- Download progress. --> | ||||
|         <ion-badge class="core-course-download-section-progress" *ngIf="section.isDownloading && section.total > 0 && section.count < section.total">{{section.count}} / {{section.total}}</ion-badge> | ||||
|         <!-- Spinner (downloading or calculating status). --> | ||||
|         <ion-spinner *ngIf="(section.isDownloading && section.total > 0) || section.isCalculating"></ion-spinner> | ||||
|         <ion-spinner *ngIf="section.isDownloading || section.isCalculating"></ion-spinner> | ||||
|     </div> | ||||
| </ng-template> | ||||
|  | ||||
| @ -1234,7 +1234,7 @@ export class CoreCourseHelperProvider { | ||||
|     prefetchSection(section: any, courseId: number, sections?: any[]): Promise<any> { | ||||
|         if (section.id != CoreCourseProvider.ALL_SECTIONS_ID) { | ||||
|             // Download only this section.
 | ||||
|             return this.prefetchSingleSectionIfNeeded(section, courseId).then(() => { | ||||
|             return this.prefetchSingleSectionIfNeeded(section, courseId).finally(() => { | ||||
|                 // Calculate the status of the section that finished.
 | ||||
|                 return this.calculateSectionStatus(section, courseId); | ||||
|             }); | ||||
| @ -1246,7 +1246,7 @@ export class CoreCourseHelperProvider { | ||||
|             section.isDownloading = true; | ||||
|             sections.forEach((section) => { | ||||
|                 if (section.id != CoreCourseProvider.ALL_SECTIONS_ID) { | ||||
|                     promises.push(this.prefetchSingleSectionIfNeeded(section, courseId).then(() => { | ||||
|                     promises.push(this.prefetchSingleSectionIfNeeded(section, courseId).finally(() => { | ||||
|                         // Calculate the status of the section that finished.
 | ||||
|                         return this.calculateSectionStatus(section, courseId).then((result) => { | ||||
|                             // Calculate "All sections" status.
 | ||||
|  | ||||
| @ -1208,7 +1208,7 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate { | ||||
|         }); | ||||
| 
 | ||||
|         // Set the promise.
 | ||||
|         prefetchData.promise = Promise.all(promises).finally(() => { | ||||
|         prefetchData.promise = this.utils.allPromises(promises).finally(() => { | ||||
|             // Unsubscribe all observers.
 | ||||
|             prefetchData.subscriptions.forEach((subscription: Subscription) => { | ||||
|                 subscription.unsubscribe(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user