fix(events): keep event-detail ticket counts live after a purchase #119

Merged
padreug merged 1 commit from feat/event-detail-live-ticket-count into dev 2026-06-18 12:44:10 +00:00

1 commit

Author SHA1 Message Date
8ade942c32 fix(events): keep event detail's ticket counts live (subscribe even when cached)
useEventDetail.load() early-returned when the event was already in the
store, so arriving from the feed (cached) set up no live subscription.
NIP-52 calendar events are replaceable and the events extension
republishes them when a ticket sells (updating tickets_sold/available),
but with no subscription the detail page never received the update —
counts went stale until a manual reload.

Always open the dTag-scoped subscription (only the one-shot query +
loading state are skipped on a cache hit), and unsubscribe a prior sub
before re-subscribing so reload() can't leak one. The reactive `event`
computed then reflects republished counts without a reload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 12:43:38 +00:00