Skip to content

Commit

Permalink
MDL-79003 eslint: Address issues reported by eslint
Browse files Browse the repository at this point in the history
This commit is a backport of MDL-74301 which should have been backported
at the time.
  • Loading branch information
kabalin authored and andrewnicols committed Jan 30, 2024
1 parent 47bc325 commit 1e24295
Show file tree
Hide file tree
Showing 28 changed files with 37 additions and 44 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion course/format/amd/build/local/courseindex/cm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion course/format/amd/build/local/courseindex/cm.min.js.map

Large diffs are not rendered by default.

19 changes: 5 additions & 14 deletions course/format/amd/src/local/courseeditor/fileuploader.js
Expand Up @@ -469,13 +469,9 @@ async function loadCourseHandlerManager(courseId) {
if (handlerManagers[courseId] !== undefined) {
return handlerManagers[courseId];
}
try {
const handlerManager = new HandlerManager(courseId);
await handlerManager.loadHandlers();
handlerManagers[courseId] = handlerManager;
} catch (error) {
throw error;
}
const handlerManager = new HandlerManager(courseId);
await handlerManager.loadHandlers();
handlerManagers[courseId] = handlerManager;
return handlerManagers[courseId];
}

Expand Down Expand Up @@ -544,13 +540,8 @@ const queueFileUpload = async function(courseId, sectionId, sectionNum, fileInfo
*/
export const uploadFilesToCourse = async function(courseId, sectionId, sectionNum, files) {
// Get the course handlers.
let handlerManager;
try {
handlerManager = await loadCourseHandlerManager(courseId);
await loadErrorStrings(courseId);
} catch (error) {
throw error;
}
const handlerManager = await loadCourseHandlerManager(courseId);
await loadErrorStrings(courseId);
for (let index = 0; index < files.length; index++) {
const fileInfo = files[index];
await queueFileUpload(courseId, sectionId, sectionNum, fileInfo, handlerManager);
Expand Down
8 changes: 2 additions & 6 deletions course/format/amd/src/local/courseindex/cm.js
Expand Up @@ -180,12 +180,8 @@ export default class Component extends DndCmItem {
const exporter = this.reactive.getExporter();
const data = exporter.cmCompletion(state, element);

try {
const {html, js} = await Templates.renderForPromise(completionTemplate, data);
Templates.replaceNode(completionElement, html, js);
} catch (error) {
throw error;
}
const {html, js} = await Templates.renderForPromise(completionTemplate, data);
Templates.replaceNode(completionElement, html, js);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/amd/build/local/reactive/overlay.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1e24295

Please sign in to comment.