Compare commits

...

2 commits

Author SHA1 Message Date
ca3ad434d3 Merge pull request 'fix(activities): surface statsError on the door-scanner page' (#89) from fix/scanner-stats-error-banner into dev
Reviewed-on: #89
2026-06-04 09:49:39 +00:00
b8910868cd fix(activities): surface statsError on the door-scanner page
useTicketScanner already captures the stats fetch error into a ref
but ScanTicketsPage never read it, so a 404 / 403 / auth failure on
GET /tickets/event/{id}/stats was completely silent — the counts
strip kept showing the last good value while scans landed on the
backend, making it look like the scanner was broken when actually
the refresh path was just dead.

Adds a small destructive-toned banner under the counts strip,
visible across both Scanner and Scanned tabs. AlertCircle already
imported. No new composable surface — statsError is already exported
from useTicketScanner.

Surfaced by a missing /stats endpoint on aio-demo's events backend
(now shipped as events 1.6.1-aio.5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 19:53:48 +02:00

View file

@ -31,6 +31,7 @@ const {
lastScan,
eventStats,
statsLoading,
statsError,
refreshStats,
onDecode,
resume,
@ -137,6 +138,22 @@ function fmtTime(iso: string) {
</div>
</div>
<!-- Surface stats fetch failures (e.g. backend missing the /stats
endpoint, or wallet ownership rejected). Without this the
counts strip silently freezes on the last good value while
scans keep landing on the backend. -->
<div
v-if="statsError"
class="mb-4 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-xs text-destructive"
role="alert"
>
<AlertCircle class="w-4 h-4 mt-0.5 shrink-0" />
<div class="min-w-0">
<p class="font-medium">Counts may be out of date</p>
<p class="text-destructive/80 mt-0.5 break-words">{{ statsError }}</p>
</div>
</div>
<Tabs v-model="activeTab" class="w-full">
<TabsList class="grid w-full grid-cols-2 mb-4">
<TabsTrigger value="scanner" class="gap-1.5">