Merge pull request #2891 from NoelDeMartin/MOBILE-3320
MOBILE-3320 course: Fix download loading statusmain
commit
d6d48ee19c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue