mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 13:02:50 +00:00
fix: prevent out-of-bounds wizard steps and remove duplicate FieldCondition property definition
This commit is contained in:
@@ -356,6 +356,14 @@ export function LicenseApplicationPage() {
|
||||
[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) {
|
||||
return <PageLoader label={t('licenseApplication.loading', 'Loading Application…')} height={400} />;
|
||||
}
|
||||
|
||||
@@ -67,8 +67,6 @@ export type FormFieldType =
|
||||
| "TIN";
|
||||
|
||||
export interface FieldCondition {
|
||||
/** Omitted when `anyOf` is used instead — see below. */
|
||||
field?: string;
|
||||
/** Omitted when `anyOf` is used instead — see below. */
|
||||
field?: string;
|
||||
equals?: string | number | boolean;
|
||||
|
||||
Reference in New Issue
Block a user