Merge pull request #1796 from dpalou/MOBILE-2850
MOBILE-2850 course: Fix prefetch after sync for some activitiesmain
commit
4015641ee5
|
@ -43,7 +43,7 @@ export class AddonModChoiceSyncProvider extends CoreCourseActivitySyncBaseProvid
|
||||||
protected appProvider: CoreAppProvider, private choiceOffline: AddonModChoiceOfflineProvider,
|
protected appProvider: CoreAppProvider, private choiceOffline: AddonModChoiceOfflineProvider,
|
||||||
private eventsProvider: CoreEventsProvider, private choiceProvider: AddonModChoiceProvider,
|
private eventsProvider: CoreEventsProvider, private choiceProvider: AddonModChoiceProvider,
|
||||||
translate: TranslateService, private utils: CoreUtilsProvider, protected textUtils: CoreTextUtilsProvider,
|
translate: TranslateService, private utils: CoreUtilsProvider, protected textUtils: CoreTextUtilsProvider,
|
||||||
courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider,
|
private courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider,
|
||||||
private logHelper: CoreCourseLogHelperProvider, prefetchHandler: AddonModChoicePrefetchHandler,
|
private logHelper: CoreCourseLogHelperProvider, prefetchHandler: AddonModChoicePrefetchHandler,
|
||||||
prefetchDelegate: CoreCourseModulePrefetchDelegate) {
|
prefetchDelegate: CoreCourseModulePrefetchDelegate) {
|
||||||
|
|
||||||
|
@ -200,7 +200,9 @@ export class AddonModChoiceSyncProvider extends CoreCourseActivitySyncBaseProvid
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (courseId) {
|
if (courseId) {
|
||||||
// Data has been sent to server, prefetch choice if needed.
|
// Data has been sent to server, prefetch choice if needed.
|
||||||
return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => {
|
return this.courseProvider.getModuleBasicInfoByInstance(choiceId, 'choice', siteId).then((module) => {
|
||||||
|
return this.prefetchAfterUpdate(module, courseId, undefined, siteId);
|
||||||
|
}).catch(() => {
|
||||||
// Ignore errors.
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ export class AddonModFeedbackSyncProvider extends CoreCourseActivitySyncBaseProv
|
||||||
protected appProvider: CoreAppProvider, private feedbackOffline: AddonModFeedbackOfflineProvider,
|
protected appProvider: CoreAppProvider, private feedbackOffline: AddonModFeedbackOfflineProvider,
|
||||||
private eventsProvider: CoreEventsProvider, private feedbackProvider: AddonModFeedbackProvider,
|
private eventsProvider: CoreEventsProvider, private feedbackProvider: AddonModFeedbackProvider,
|
||||||
protected translate: TranslateService, private utils: CoreUtilsProvider, protected textUtils: CoreTextUtilsProvider,
|
protected translate: TranslateService, private utils: CoreUtilsProvider, protected textUtils: CoreTextUtilsProvider,
|
||||||
courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider,
|
private courseProvider: CoreCourseProvider, syncProvider: CoreSyncProvider, timeUtils: CoreTimeUtilsProvider,
|
||||||
private logHelper: CoreCourseLogHelperProvider, prefetchDelegate: CoreCourseModulePrefetchDelegate,
|
private logHelper: CoreCourseLogHelperProvider, prefetchDelegate: CoreCourseModulePrefetchDelegate,
|
||||||
prefetchHandler: AddonModFeedbackPrefetchHandler) {
|
prefetchHandler: AddonModFeedbackPrefetchHandler) {
|
||||||
|
|
||||||
|
@ -236,7 +236,9 @@ export class AddonModFeedbackSyncProvider extends CoreCourseActivitySyncBaseProv
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (result.updated) {
|
if (result.updated) {
|
||||||
// Data has been sent to server, update data.
|
// Data has been sent to server, update data.
|
||||||
return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => {
|
return this.courseProvider.getModuleBasicInfoByInstance(feedbackId, 'feedback', siteId).then((module) => {
|
||||||
|
return this.prefetchAfterUpdate(module, courseId, undefined, siteId);
|
||||||
|
}).catch(() => {
|
||||||
// Ignore errors.
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ export class AddonModLessonSyncProvider extends CoreCourseActivitySyncBaseProvid
|
||||||
|
|
||||||
constructor(loggerProvider: CoreLoggerProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
|
constructor(loggerProvider: CoreLoggerProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
|
||||||
syncProvider: CoreSyncProvider, textUtils: CoreTextUtilsProvider, translate: TranslateService,
|
syncProvider: CoreSyncProvider, textUtils: CoreTextUtilsProvider, translate: TranslateService,
|
||||||
courseProvider: CoreCourseProvider, private eventsProvider: CoreEventsProvider,
|
private courseProvider: CoreCourseProvider, private eventsProvider: CoreEventsProvider,
|
||||||
private lessonProvider: AddonModLessonProvider, private lessonOfflineProvider: AddonModLessonOfflineProvider,
|
private lessonProvider: AddonModLessonProvider, private lessonOfflineProvider: AddonModLessonOfflineProvider,
|
||||||
protected prefetchHandler: AddonModLessonPrefetchHandler, timeUtils: CoreTimeUtilsProvider,
|
protected prefetchHandler: AddonModLessonPrefetchHandler, timeUtils: CoreTimeUtilsProvider,
|
||||||
private utils: CoreUtilsProvider, private urlUtils: CoreUrlUtilsProvider,
|
private utils: CoreUtilsProvider, private urlUtils: CoreUrlUtilsProvider,
|
||||||
|
@ -431,7 +431,9 @@ export class AddonModLessonSyncProvider extends CoreCourseActivitySyncBaseProvid
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (result.updated && courseId) {
|
if (result.updated && courseId) {
|
||||||
// Data has been sent to server, update data.
|
// Data has been sent to server, update data.
|
||||||
return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => {
|
return this.courseProvider.getModuleBasicInfoByInstance(lessonId, 'lesson', siteId).then((module) => {
|
||||||
|
return this.prefetchAfterUpdate(module, courseId, undefined, siteId);
|
||||||
|
}).catch(() => {
|
||||||
// Ignore errors.
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ export class AddonModSurveySyncProvider extends CoreCourseActivitySyncBaseProvid
|
||||||
|
|
||||||
constructor(loggerProvider: CoreLoggerProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
|
constructor(loggerProvider: CoreLoggerProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
|
||||||
syncProvider: CoreSyncProvider, textUtils: CoreTextUtilsProvider, translate: TranslateService,
|
syncProvider: CoreSyncProvider, textUtils: CoreTextUtilsProvider, translate: TranslateService,
|
||||||
courseProvider: CoreCourseProvider, private surveyOffline: AddonModSurveyOfflineProvider,
|
private courseProvider: CoreCourseProvider, private surveyOffline: AddonModSurveyOfflineProvider,
|
||||||
private eventsProvider: CoreEventsProvider, private surveyProvider: AddonModSurveyProvider,
|
private eventsProvider: CoreEventsProvider, private surveyProvider: AddonModSurveyProvider,
|
||||||
private utils: CoreUtilsProvider, timeUtils: CoreTimeUtilsProvider, private logHelper: CoreCourseLogHelperProvider,
|
private utils: CoreUtilsProvider, timeUtils: CoreTimeUtilsProvider, private logHelper: CoreCourseLogHelperProvider,
|
||||||
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModSurveyPrefetchHandler) {
|
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModSurveyPrefetchHandler) {
|
||||||
|
@ -195,7 +195,9 @@ export class AddonModSurveySyncProvider extends CoreCourseActivitySyncBaseProvid
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (courseId) {
|
if (courseId) {
|
||||||
// Data has been sent to server, update survey data.
|
// Data has been sent to server, update survey data.
|
||||||
return this.prefetchAfterUpdate(module, courseId, undefined, siteId).catch(() => {
|
return this.courseProvider.getModuleBasicInfoByInstance(surveyId, 'survey', siteId).then((module) => {
|
||||||
|
return this.prefetchAfterUpdate(module, courseId, undefined, siteId);
|
||||||
|
}).catch(() => {
|
||||||
// Ignore errors.
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue