small fix for powder error handling

This commit is contained in:
reschan 2022-05-15 23:16:22 +07:00
parent 9a52699bfa
commit 629f37b9cd

View file

@ -182,7 +182,7 @@ function update_field(field) {
document.querySelector("#" + field + "-powder").classList.remove("is-invalid");
let powder_string = document.querySelector("#"+field+"-powder").value;
if (powder_string.length % 2 != 0 || powder_string / 2 > powder_slots) {
if (powder_string.length % 2 != 0 || powder_string.length / 2 > powder_slots) {
document.querySelector("#"+field+"-powder").classList.add("is-invalid");
} else {
for (i = 0; i < powder_string.length / 2; i++) {