feat(tools): Remove requirement for ten-diget codes

This commit is contained in:
Nicolai Ort 2025-05-01 20:51:01 +02:00
parent 25c38ea381
commit 80ca7aa08b
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F

View File

@ -72,29 +72,25 @@
}); });
function handleInput(input) { function handleInput(input) {
if (`${input}`.length > 10) { ScanService.scanControllerPostTrackScans({
cardCode = input; card: parseInt(input),
station: selectedStation,
ScanService.scanControllerPostTrackScans({ })
card: parseInt(cardCode), .then((data) => {
station: selectedStation, scaninfo = data;
}) if (scaninfo.valid) {
.then((data) => { new Audio("/beep.mp3").play();
scaninfo = data; state = "scan_card";
if (scaninfo.valid) { } else {
new Audio("/beep.mp3").play(); state = "error_invalid";
state = "scan_success";
} else {
state = "error_invalid";
new Audio("/error.mp3").play();
}
})
.catch((err) => {
console.error(err);
state = "error_card";
new Audio("/error.mp3").play(); new Audio("/error.mp3").play();
}); }
} })
.catch((err) => {
console.error(err);
state = "error_card";
new Audio("/error.mp3").play();
});
} }
</script> </script>
@ -214,7 +210,6 @@
e.detail.decodedText.length - 1 e.detail.decodedText.length - 1
); );
} }
scannerActive = false;
console.log({ type: "DETECT", code: e.detail.decodedText }); console.log({ type: "DETECT", code: e.detail.decodedText });
handleInput(e.detail.decodedText); handleInput(e.detail.decodedText);
} }