Merge pull request #2103 from dpalou/MOBILE-3132

MOBILE-3132 mod: Fill context menu even if there's an error
main
Juan Leyva 2019-10-01 11:15:31 +02:00 committed by GitHub
commit 656c83e740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 23 additions and 40 deletions

View File

@ -219,8 +219,7 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo
}
});
});
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -163,12 +163,11 @@ export class AddonModBookIndexComponent extends CoreCourseModuleMainResourceComp
// We could load the main file but the download failed. Show error message.
this.domUtils.showErrorModal('core.errordownloadingsomefiles', true);
}
// All data obtained, now fill the context menu.
this.fillContextMenu(refresh);
}).catch(() => {
// Ignore errors, they're handled inside the loadChapter function.
});
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -82,12 +82,11 @@ export class AddonModChatIndexComponent extends CoreCourseModuleMainActivityComp
this.dataRetrieved.emit(chat);
// All data obtained, now fill the context menu.
this.fillContextMenu(refresh);
return this.chatProvider.areSessionsAvailable().then((available) => {
this.sessionsAvailable = available;
});
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -156,8 +156,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo
return this.fetchOptions(hasOffline).then(() => {
return this.fetchResults();
});
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -247,12 +247,10 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
return this.fetchEntriesData();
});
}).then(() => {
// All data obtained, now fill the context menu.
this.fillContextMenu(refresh);
}).finally(() => {
this.canAdd = canAdd;
this.canSearch = canSearch;
this.fillContextMenu(refresh);
});
}

View File

@ -126,8 +126,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo
return promise.then((folder) => {
this.showModuleData(folder);
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -244,8 +244,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
this.domUtils.showErrorModalDefault(message, 'addon.mod_forum.errorgetforum', true);
this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -158,8 +158,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
}));
return Promise.all(promises);
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -112,7 +112,7 @@ export class AddonModImscpIndexComponent extends CoreCourseModuleMainResourceCom
this.domUtils.showErrorModal('core.errordownloadingsomefiles', true);
}
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -211,6 +211,8 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo
this.lessonReady(refresh);
}
});
}).finally(() => {
this.fillContextMenu(refresh);
});
}
@ -336,9 +338,6 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo
// Store the password in DB.
this.lessonProvider.storePassword(this.lesson.id, this.password);
}
// All data obtained, now fill the context menu.
this.fillContextMenu(refresh);
}
/**

View File

@ -67,8 +67,7 @@ export class AddonModLtiIndexComponent extends CoreCourseModuleMainActivityCompo
this.lti = ltiData;
this.description = this.lti.intro;
this.dataRetrieved.emit(this.lti);
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -127,8 +127,6 @@ export class AddonModPageIndexComponent extends CoreCourseModuleMainResourceComp
// Get the page HTML.
promises.push(this.pageHelper.getPageHtml(this.module.contents, this.module.id).then((content) => {
// All data obtained, now fill the context menu.
this.fillContextMenu(refresh);
this.contents = content;
@ -139,6 +137,8 @@ export class AddonModPageIndexComponent extends CoreCourseModuleMainResourceComp
}));
return Promise.all(promises);
}).finally(() => {
this.fillContextMenu(refresh);
});
}
}

View File

@ -224,11 +224,10 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp
});
}).then(() => {
// All data obtained, now fill the context menu.
this.fillContextMenu(refresh);
// Quiz is ready to be shown, move it to the variable that is displayed.
this.quiz = this.quizData;
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -135,8 +135,7 @@ export class AddonModResourceIndexComponent extends CoreCourseModuleMainResource
} else {
this.mode = 'external';
}
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -254,8 +254,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom
}
});
});
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -126,8 +126,7 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo
if (!this.survey.surveydone && !this.hasOffline) {
return this.fetchQuestions();
}
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}

View File

@ -299,8 +299,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
return this.fetchWikiPage();
});
});
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
}).catch((error) => {
if (this.pageWarning) {

View File

@ -231,8 +231,7 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
});
}).then(() => {
return this.setPhaseInfo();
}).then(() => {
// All data obtained, now fill the context menu.
}).finally(() => {
this.fillContextMenu(refresh);
});
}