From e1b00b0f5b245244d0c479cf2be2d1d9bd928cde Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Fri, 27 Oct 2023 17:48:14 +0200 Subject: [PATCH] Make init more async --- app/assets/javascripts/editor.ts | 1 - app/assets/javascripts/exercise.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/editor.ts b/app/assets/javascripts/editor.ts index 529d024848..9919d78e41 100644 --- a/app/assets/javascripts/editor.ts +++ b/app/assets/javascripts/editor.ts @@ -197,7 +197,6 @@ export async function configureEditor(parent: Element, programmingLanguage: stri const languageSupport = await loadProgrammingLanguage(programmingLanguage); const languageExtensions = []; if (languageSupport !== undefined) { - console.log(languageSupport); languageExtensions.push(languageSupport); } return new EditorView({ diff --git a/app/assets/javascripts/exercise.ts b/app/assets/javascripts/exercise.ts index 81e214ea41..8c21e86d13 100644 --- a/app/assets/javascripts/exercise.ts +++ b/app/assets/javascripts/exercise.ts @@ -145,10 +145,11 @@ async function initExerciseShow(exerciseId: number, programmingLanguage: string, async function init(): Promise { if (editorShown) { - await initEditor(); + const editorReady = initEditor(); initDeadlineTimeout(); enableSubmissionTableLinks(); swapActionButtons(); + await editorReady; initRestoreBoilerplateButton(boilerplate); }