mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Merge pull request #660 from Tria-plc/alpha
Fix error message on passenger information
This commit is contained in:
@@ -994,8 +994,20 @@ function PassengersForm() {
|
||||
const onInvalid = () => {
|
||||
// Sections still behind the Fayda verify screen stay collapsed here — they only expand
|
||||
// when the user explicitly clicks "Enter details manually" (shown only when Fayda is
|
||||
// unavailable).
|
||||
setSubmitError('Please fix the highlighted errors before continuing.');
|
||||
// unavailable). Their name/DOB/gender fields are still empty at this point, which would
|
||||
// otherwise surface as a generic "fix the highlighted errors" message that doesn't point
|
||||
// at the actual cause — tell the user to verify with Fayda instead.
|
||||
const needsFaydaVerification = passengers.some((p, i) => {
|
||||
const isEthiopian = p?.nationality === 'ETHIOPIAN';
|
||||
const isChildPassenger = i >= adultCount;
|
||||
const isLoggedInAndVerified = i === 0 && isAuthenticated && user?.faydaVerified;
|
||||
return isEthiopian && faydaEnabled && !p?.formExpanded && !isLoggedInAndVerified && !isChildPassenger;
|
||||
});
|
||||
setSubmitError(
|
||||
needsFaydaVerification
|
||||
? 'Please verify your identity with Fayda before continuing — tap "Verify with Fayda" above to proceed.'
|
||||
: 'Please fix the highlighted errors before continuing.'
|
||||
);
|
||||
};
|
||||
|
||||
const onSubmit = async (data: FormData) => {
|
||||
|
||||
Reference in New Issue
Block a user