From 842683a8d0f8494a924e902e238aba349680fb50 Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Fri, 13 Oct 2023 12:38:40 +0700 Subject: [PATCH] feat: menambahkan kemudahan untuk attendance --- .../renderer/src/components/PreScan/ErrorOccured.tsx | 2 +- .../src/components/Scanner/NormalScanner.tsx | 12 ++++++------ .../src/components/Scanner/ScanningError.tsx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) 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!