Ensure that the builder isn't too long
This commit is contained in:
@@ -37,7 +37,9 @@ function composeDigit(digit) {
|
||||
clearTimeout(taskId);
|
||||
taskId = null;
|
||||
}
|
||||
builder += digit.toString();
|
||||
if (builder.length < CODE.length) {
|
||||
builder += digit.toString();
|
||||
}
|
||||
display.innerText = builder + '_'.repeat(CODE.length - builder.length);
|
||||
light.classList.remove(IS_SUCCESS, IS_ERROR);
|
||||
if (CODE.startsWith(builder)) {
|
||||
|
Reference in New Issue
Block a user