Skip to main content

useWaiverSync

Source: hooks/commits/useWaiverSync.ts The useWaiverSync hook synchronizes the waiver configuration between the (penaltywaiver) route group screens and the useTaskDraftStore.

Sync Direction

Identical pattern to usePenaltySync: Read direction: Pre-populates waiver form fields from the draft store on mount. Write direction: Writes each configuration change back to the draft store’s penalty_waiver field in real-time.

Waiver Object Structure


Dependency on Penalty

The waiver config is only meaningful if a penalty is configured. If the user removes the penalty from the draft, the waiver config is automatically cleared to prevent orphaned waiver configurations.