Merge pull request #2891 from NoelDeMartin/MOBILE-3320

MOBILE-3320 course: Fix download loading status
main
Dani Palou 2021-07-19 08:16:51 +02:00 committed by GitHub
commit d6d48ee19c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

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