Skip to content

Commit 34abd33

Browse files
tacerusfionera
authored andcommitted
feat(web): skip countdown if zero
Avoid superfluous "Reloading in ..." message if a countdown of zero is configured. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
1 parent cc3bfbc commit 34abd33

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

web/src/challange/loader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ export function stop(countdown, failed = false){
5050
setChallengeInfo("Challenge succeeded.");
5151
container.classList.add("alert-success");
5252

53+
if (countdown === 0){
54+
setChallengeInfo("Reloading ...");
55+
window.location.reload();
56+
}
57+
5358
const interval = setInterval(() => {
5459
setChallengeInfo(`Reloading in ${countdown}...`);
5560
if (countdown === 0){

0 commit comments

Comments
 (0)