Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

ISSUE 217 - Fix check-in scanner not scanning after invalid ticket scan

Dave Earleyd39490946da7
diff --git a/frontend/src/components/common/AttendeeCheckInTable/QrScanner.tsx b/frontend/src/components/common/AttendeeCheckInTable/QrScanner.tsx
index f36f8ab2c..c90465173 100644
--- a/frontend/src/components/common/AttendeeCheckInTable/QrScanner.tsx
+++ b/frontend/src/components/common/AttendeeCheckInTable/QrScanner.tsx
@@ -8,7 +8,7 @@ import {showError} from "../../../utilites/notifications.tsx";
import {t, Trans} from "@lingui/macro";
interface QRScannerComponentProps {
- onCheckIn: (attendeePublicId: string, onRequestComplete?: () => void) => void;
+ onCheckIn: (attendeePublicId: string, onRequestComplete: () => void, onFailure: () => void) => void;
onClose: () => void;
}
@@ -62,10 +62,14 @@ export const QRScannerComponent = (props: QRScannerComponentProps) => {
if (!isCheckingIn && !alreadyScanned) {
setIsCheckingIn(true);
props.onCheckIn(debouncedAttendeeId, () => {
- setIsCheckingIn(false);
- setProcessedAttendeeIds(prevIds => [...prevIds, debouncedAttendeeId]);
- setCurrentAttendeeId(null);
- });
+ setIsCheckingIn(false);
+ setProcessedAttendeeIds(prevIds => [...prevIds, debouncedAttendeeId]);
+ setCurrentAttendeeId(null);
+ }, () => {
+ setIsCheckingIn(false);
+ setCurrentAttendeeId(null);
+ }
+ );
}
}
}, [debouncedAttendeeId]);
diff --git a/frontend/src/components/layouts/CheckIn/index.tsx b/frontend/src/components/layouts/CheckIn/index.tsx
index 33af1061e..9b5e65e9b 100644
--- a/frontend/src/components/layouts/CheckIn/index.tsx
+++ b/frontend/src/components/layouts/CheckIn/index.tsx
@@ -100,7 +100,7 @@ const CheckIn = () => {
)
}
- const handleQrCheckIn = (attendeePublicId: string, onRequestComplete?: () => void) => {
+ const handleQrCheckIn = (attendeePublicId: string, onRequestComplete: () => void, onFailure: () => void) => {
checkInMutation.mutate({
checkInListShortId: checkInListShortId,
attendeePublicId: attendeePublicId,
@@ -119,6 +119,8 @@ const CheckIn = () => {
showSuccess(t`Checked in successfully`);
},
onError: (error) => {
+ onFailure();
+
if (!networkStatus.online) {
showError(t`You are offline`);
return;