diff options
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/js/login.js | 9 | ||||
-rw-r--r-- | src/main/resources/views/login.rocker.html | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/main/resources/js/login.js b/src/main/resources/js/login.js index f4e2bce..aa991db 100644 --- a/src/main/resources/js/login.js +++ b/src/main/resources/js/login.js @@ -1,7 +1,8 @@ const tryAgain = document.getElementById("tryAgain"); const countdown = document.getElementById("counter"); -setInterval(() => { - if (Number(countdown.innerText) === 0) tryAgain.style.display = "none"; - countdown.innerText = Number(countdown.innerText) - 1; -}, 1000); +if (tryAgain !== null) + setInterval(() => { + if (Number(countdown.innerText) === 0) tryAgain.style.display = "none"; + countdown.innerText = Number(countdown.innerText) - 1; + }, 1000); diff --git a/src/main/resources/views/login.rocker.html b/src/main/resources/views/login.rocker.html index 23a9aff..bcee9df 100644 --- a/src/main/resources/views/login.rocker.html +++ b/src/main/resources/views/login.rocker.html @@ -20,6 +20,9 @@ @if(message.length() > 0) { <small>@message</small> + } + + @if(counter > 0) { <small id="tryAgain">Please try again in <span id="counter">@counter</span> seconds.</small> } </form> |