Skip to content

Commit

Permalink
fix: use isLastStep
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Nov 8, 2023
1 parent 508d041 commit e86659a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions apps/theme/layouts/forms/DefaultFormLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>): Promise<void> => {
if (isLastStep) {
setLoading(true);
Expand Down Expand Up @@ -118,7 +117,7 @@ const DefaultFormLayout: FormLayoutComponent = ({
>
Previous Step
</Button>
{currentStepIndex === formData.steps.length - 1 ? (
{isLastStep ? (
<Button
type="primary"
onClick={submit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>): Promise<void> => {
if (isLastStep) {
setLoading(true);
Expand Down Expand Up @@ -118,7 +117,7 @@ const DefaultFormLayout: FormLayoutComponent = ({
>
Previous Step
</Button>
{currentStepIndex === formData.steps.length - 1 ? (
{isLastStep ? (
<Button
type="primary"
onClick={submit}
Expand Down

0 comments on commit e86659a

Please sign in to comment.