MOBILE-3320 course: Fix download loading status

main
Noel De Martin 2021-07-13 09:30:44 +02:00
parent ad976e2b2d
commit 1ff4bb17ef
1 changed files with 3 additions and 0 deletions

View File

@ -381,6 +381,7 @@ export class CoreCourseHelperProvider {
data.downloadSucceeded = false;
data.icon = CoreConstants.ICON_DOWNLOADING;
data.status = CoreConstants.DOWNLOADING;
data.loading = true;
data.statusTranslatable = 'core.downloading';
try {
@ -405,11 +406,13 @@ export class CoreCourseHelperProvider {
// Download successful.
data.downloadSucceeded = true;
data.loading = false;
} catch (error) {
// User cancelled or there was an error.
data.icon = initialIcon;
data.status = initialStatus;
data.statusTranslatable = initialStatusTranslatable;
data.loading = false;
throw error;
}