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