fix: avoid duplicate rectification errors

This commit is contained in:
Jesse_Chen
2026-07-19 20:24:44 +08:00
parent aeef08f79e
commit 82d48c0777
4 changed files with 10 additions and 11 deletions
@@ -69,6 +69,8 @@ export function BirthTimeRectification(props: BirthTimeRectificationProps) {
const heading = dynamicHeading(action);
const error = props.controller.error || props.externalError;
const showsProgress = action.kind !== "ask_dynamic_choice" && action.kind !== "clarify_unmatched_answer";
const childOwnsError = action.kind === "ask_dynamic_choice"
|| action.kind === "clarify_unmatched_answer";
const showsCandidate = action.kind === "present_low_result"
|| action.kind === "present_medium_result"
|| action.kind === "request_candidate_confirmation"
@@ -122,7 +124,7 @@ export function BirthTimeRectification(props: BirthTimeRectificationProps) {
journey={props.journey}
/>
) : null}
{error && !showsCandidate ? <p className="form-error" role="alert">{error}</p> : null}
{error && !showsCandidate && !childOwnsError ? <p className="form-error" role="alert">{error}</p> : null}
</section>
);
}