From a740f052a7aafe95c470be46753a1d487f5f3789 Mon Sep 17 00:00:00 2001 From: adrians5j Date: Thu, 2 Nov 2023 14:41:32 +0100 Subject: [PATCH] fix: use `isLastStep` --- apps/theme/layouts/forms/DefaultFormLayout.tsx | 7 +++---- .../common/apps/theme/layouts/forms/DefaultFormLayout.tsx | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/theme/layouts/forms/DefaultFormLayout.tsx b/apps/theme/layouts/forms/DefaultFormLayout.tsx index b4b130ebe1a..537486e69da 100644 --- a/apps/theme/layouts/forms/DefaultFormLayout.tsx +++ b/apps/theme/layouts/forms/DefaultFormLayout.tsx @@ -67,9 +67,8 @@ const DefaultFormLayout: FormLayoutComponent = ({ // All form fields - an array of rows where each row is an array that contain fields. const fields = getFields(currentStepIndex); - /** - * Once the data is successfully submitted, we show a success message. - */ + + // Once the data is successfully submitted, we show a success message. const submitForm = async (data: Record): Promise => { if (isLastStep) { setLoading(true); @@ -118,7 +117,7 @@ const DefaultFormLayout: FormLayoutComponent = ({ > Previous Step - {currentStepIndex === formData.steps.length - 1 ? ( + {isLastStep ? ( - {currentStepIndex === formData.steps.length - 1 ? ( + {isLastStep ? (