Form: confirm dialog before submitting check-in

Adds a native window.confirm() inside onSubmit, after the uploads-in-flight
guard and before the submitting-state flip. Runs only after react-hook-form
validation passes, so users who hit Submit on an incomplete form still see
the existing field-level errors via onInvalid rather than a confusing
"are you sure?" prompt. Cancelling leaves the form state untouched.
This commit is contained in:
Joel Brock
2026-06-09 13:44:33 -07:00
parent 4d194176b1
commit 1364917ada
+6
View File
@@ -300,6 +300,12 @@ export function EngagementForm({ config, cid, cs }: EngagementFormProps) {
});
return;
}
const confirmed = window.confirm(
"Submit your check-in?\n\n" +
"Please confirm your responses are complete and ready. " +
"After submitting, you can come back later and submit another check-in with updates.",
);
if (!confirmed) return;
setSubmitState({ kind: "submitting" });
try {
// Strip values for hidden fields — never write data the user couldn't see.