diff --git a/apps/desktop/attendance/src/renderer/src/components/PreScan/ErrorOccured.tsx b/apps/desktop/attendance/src/renderer/src/components/PreScan/ErrorOccured.tsx index ce74d5f8..346e1ed2 100644 --- a/apps/desktop/attendance/src/renderer/src/components/PreScan/ErrorOccured.tsx +++ b/apps/desktop/attendance/src/renderer/src/components/PreScan/ErrorOccured.tsx @@ -16,7 +16,7 @@ const ErrorOcurred: React.FC = () => { alignItems="center" justifyContent="center" > - + location.reload()}> Terjadi Kesalahan Internal diff --git a/apps/desktop/attendance/src/renderer/src/components/Scanner/NormalScanner.tsx b/apps/desktop/attendance/src/renderer/src/components/Scanner/NormalScanner.tsx index 6ba30b70..cb761eca 100644 --- a/apps/desktop/attendance/src/renderer/src/components/Scanner/NormalScanner.tsx +++ b/apps/desktop/attendance/src/renderer/src/components/Scanner/NormalScanner.tsx @@ -24,16 +24,16 @@ const NormalScanner = ({ const qrScanner = new QrScanner( videoRef.current, ({ data }) => { - // Bug from QR Scanner - if (!data || data === "") return; + if (data || data !== "") { - qrScanner.stop(); + qrScanner.stop(); - const isValidQr = validateId(data); + const isValidQr = validateId(data); - if (!isValidQr) return setInvalidQr(true); + if (!isValidQr) return setInvalidQr(true); - participantAttend.mutate(data); + participantAttend.mutate(data); + } }, { highlightCodeOutline: true, diff --git a/apps/desktop/attendance/src/renderer/src/components/Scanner/ScanningError.tsx b/apps/desktop/attendance/src/renderer/src/components/Scanner/ScanningError.tsx index b64b6d40..6821a27f 100644 --- a/apps/desktop/attendance/src/renderer/src/components/Scanner/ScanningError.tsx +++ b/apps/desktop/attendance/src/renderer/src/components/Scanner/ScanningError.tsx @@ -18,7 +18,7 @@ const ScanningError = ({ message }: { message: string }) => { justifyContent="center" flexDirection="column" > - + location.reload()}> Gagal Absen!