From 4eff95f1d4a8beea2920a5d6f35e20fc293781ff Mon Sep 17 00:00:00 2001 From: Daniils Petrovs Date: Sun, 23 Jun 2024 15:40:35 +0200 Subject: [PATCH] Simplify scanner --- src/routes/scanner/+page.svelte | 34 ++++----------------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/routes/scanner/+page.svelte b/src/routes/scanner/+page.svelte index 2032ec1..de4b4b4 100644 --- a/src/routes/scanner/+page.svelte +++ b/src/routes/scanner/+page.svelte @@ -6,11 +6,10 @@ import { tokenHash } from '../../crypto'; import { TOAST_TYPE, SCANNER_STATE, type ScannerState } from '../../custom'; - import { Icon } from '@steeze-ui/svelte-icon'; - import { Ticket, QrCode, StopCircle } from '@steeze-ui/heroicons'; import { getCollectedCount, getExpectedStampHashes, saveStamp } from '$lib/stores/stamps'; import { setToast } from '$lib/stores/toasts'; import { minStampCountRequired } from '../../const'; + import { goto } from '$app/navigation'; let state: ScannerState = 'STOPPED'; @@ -44,7 +43,6 @@ type: TOAST_TYPE.ERROR, message: 'Invalid QR code!' }); - return; } transitionState(); @@ -73,6 +71,7 @@ message: 'Invalid Stamp!' }); } + goto('/'); } function parseTokenFromScan(data: string): string { @@ -95,6 +94,8 @@ videoElem.setAttribute('playsinline', 'true'); videoElem.setAttribute('autoplay', 'true'); videoElem.setAttribute('muted', 'true'); + + transitionState(); }); onDestroy(() => { @@ -107,23 +108,6 @@

Scanner

Press Scan, and scan the QR code of the stamp!

-
- -
-
- -
- - - View collected stamps -