From d31db593597cf056835644a1f2b93e9a96ff59b3 Mon Sep 17 00:00:00 2001 From: padreug Date: Thu, 18 Sep 2025 22:16:00 +0200 Subject: [PATCH] Fix QR scanner loading state condition and remove unused video element reference - Updated the loading state condition in qr-scanner.vue to check for camera permission correctly. - Removed the unused videoElement reference in useQRScanner.ts to clean up the code. These changes improve the functionality and clarity of the QR scanner component. --- src/components/ui/qr-scanner.vue | 2 +- src/composables/useQRScanner.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/ui/qr-scanner.vue b/src/components/ui/qr-scanner.vue index 4eb1bac..0e4b939 100644 --- a/src/components/ui/qr-scanner.vue +++ b/src/components/ui/qr-scanner.vue @@ -44,7 +44,7 @@ -
+

Starting camera...

diff --git a/src/composables/useQRScanner.ts b/src/composables/useQRScanner.ts index cd660b2..aca5fda 100644 --- a/src/composables/useQRScanner.ts +++ b/src/composables/useQRScanner.ts @@ -8,12 +8,10 @@ export function useQRScanner() { const scanResult = ref(null) let qrScanner: QrScanner | null = null - let videoElement: HTMLVideoElement | null = null const startScanning = async (videoEl: HTMLVideoElement, onResult: (result: string) => void) => { try { error.value = null - videoElement = videoEl // Check if camera is available const hasCamera = await QrScanner.hasCamera()