fix: prevent out-of-bounds wizard steps and remove duplicate FieldCondition property definition

This commit is contained in:
estifanos
2026-08-26 09:52:31 +00:00
parent 3cab22b58d
commit b099870370
2 changed files with 8 additions and 2 deletions

View File

@@ -356,6 +356,14 @@ export function LicenseApplicationPage() {
[steps], [steps],
); );
// A section-level showWhen can remove a step while the wizard is open
// (ENDORSEMENT_SEAFARER's certificate sections follow the chosen scope).
// Clamp so `steps[active]` can never go out of bounds if a seed ever lets
// a later answer hide an earlier step.
useEffect(() => {
if (active > steps.length - 1) setActive(Math.max(0, steps.length - 1));
}, [active, steps.length]);
if (loadingConfig || !config || !appId || !application) { if (loadingConfig || !config || !appId || !application) {
return <PageLoader label={t('licenseApplication.loading', 'Loading Application…')} height={400} />; return <PageLoader label={t('licenseApplication.loading', 'Loading Application…')} height={400} />;
} }

View File

@@ -67,8 +67,6 @@ export type FormFieldType =
| "TIN"; | "TIN";
export interface FieldCondition { export interface FieldCondition {
/** Omitted when `anyOf` is used instead — see below. */
field?: string;
/** Omitted when `anyOf` is used instead — see below. */ /** Omitted when `anyOf` is used instead — see below. */
field?: string; field?: string;
equals?: string | number | boolean; equals?: string | number | boolean;