From 80ca7aa08bdd44591e2d3efaa8e59dd4db5c864e Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 1 May 2025 20:51:01 +0200 Subject: [PATCH] feat(tools): Remove requirement for ten-diget codes --- src/components/tools/ScanClient.svelte | 41 +++++++++++--------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/components/tools/ScanClient.svelte b/src/components/tools/ScanClient.svelte index 75ae7693..3ec6ab8d 100644 --- a/src/components/tools/ScanClient.svelte +++ b/src/components/tools/ScanClient.svelte @@ -72,29 +72,25 @@ }); function handleInput(input) { - if (`${input}`.length > 10) { - cardCode = input; - - ScanService.scanControllerPostTrackScans({ - card: parseInt(cardCode), - station: selectedStation, - }) - .then((data) => { - scaninfo = data; - if (scaninfo.valid) { - new Audio("/beep.mp3").play(); - state = "scan_success"; - } else { - state = "error_invalid"; - new Audio("/error.mp3").play(); - } - }) - .catch((err) => { - console.error(err); - state = "error_card"; + ScanService.scanControllerPostTrackScans({ + card: parseInt(input), + station: selectedStation, + }) + .then((data) => { + scaninfo = data; + if (scaninfo.valid) { + new Audio("/beep.mp3").play(); + state = "scan_card"; + } else { + state = "error_invalid"; new Audio("/error.mp3").play(); - }); - } + } + }) + .catch((err) => { + console.error(err); + state = "error_card"; + new Audio("/error.mp3").play(); + }); } @@ -214,7 +210,6 @@ e.detail.decodedText.length - 1 ); } - scannerActive = false; console.log({ type: "DETECT", code: e.detail.decodedText }); handleInput(e.detail.decodedText); }