diff --git a/app/assets/javascripts/exercise.ts b/app/assets/javascripts/exercise.ts index ed304c5f49..d02b41e643 100644 --- a/app/assets/javascripts/exercise.ts +++ b/app/assets/javascripts/exercise.ts @@ -318,6 +318,10 @@ async function initExerciseShow(exerciseId: number, programmingLanguage: string, } function enableSubmitButton(): void { + if (!loggedIn) { + return; + } + const btn = document.getElementById("editor-process-btn") as HTMLButtonElement; btn.disabled = false; btn.classList.remove("busy", "mdi-timer-sand-empty", "mdi-spin"); @@ -325,6 +329,10 @@ async function initExerciseShow(exerciseId: number, programmingLanguage: string, } function disableSubmitButton(): void { + if (!loggedIn) { + return; + } + const btn = document.getElementById("editor-process-btn") as HTMLButtonElement; btn.disabled = true; btn.classList.remove("mdi-send");