Skip to main content

useUpcomingVerification

Source: hooks/commits/useUpcomingVerification.ts (40 lines) The useUpcomingVerification hook subscribes to the Convex backend’s dedicated “next” query and pushes the result into the global useVerificationStore. It is a headless hook — it returns null and exists purely for its side effects.

Server-Authoritative Design

Unlike the previous implementation that polled locally every 30 seconds with a 7-day horizon cap, this hook delegates scheduling entirely to the server:

Implementation

Convex automatically re-runs the query when time passes or the underlying data changes, providing real-time updates without client-side timers.

Store Integration

The result is written to useVerificationStore.upcomingEvent, which is consumed by the Dashboard’s upcoming verification card to display countdown timers and quick-access navigation.