From 79de7f7021db453ebeb1bc4d6abe48771980a7a8 Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Wed, 28 Feb 2024 18:32:03 +0530 Subject: [PATCH 1/2] fix back button issue --- .../SiteBuildHeader/step-navigation.js | 19 +++++++++++++------ .../components/StartOptions/index.js | 3 +-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/OnboardingSPA/components/Header/components/SiteBuildHeader/step-navigation.js b/src/OnboardingSPA/components/Header/components/SiteBuildHeader/step-navigation.js index 7748abe96..77f33c2ca 100644 --- a/src/OnboardingSPA/components/Header/components/SiteBuildHeader/step-navigation.js +++ b/src/OnboardingSPA/components/Header/components/SiteBuildHeader/step-navigation.js @@ -126,8 +126,19 @@ const StepNavigation = () => { showErrorDialog: select( nfdOnboardingStore ).getShowErrorDialog(), }; }, [] ); - const isFirstStep = null === previousStep || false === previousStep; + let isFirstStep = null === previousStep || false === previousStep; const isLastStep = null === nextStep || false === nextStep; + + let isDisabled = false; + if ( currentStep === stepWelcome ) { + if ( currentData.continueWithoutAi === true ) { + isFirstStep = false; + isDisabled = false; + } else { + isFirstStep = true; + } + } + return (
@@ -135,11 +146,7 @@ const StepNavigation = () => { ) } { isLastStep ? ( diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js index 64be9a629..476198046 100644 --- a/src/OnboardingSPA/components/StartOptions/index.js +++ b/src/OnboardingSPA/components/StartOptions/index.js @@ -49,8 +49,7 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => { window.nfdOnboarding.currentFlow = newFlow; currentData.activeFlow = newFlow; - currentData.continueWithoutAi = false; - setContinueWithoutAi( false ); + currentData.continueWithoutAi = true; setCurrentOnboardingData( currentData ); if ( SITEGEN_FLOW !== newFlow ) { updateInitialize( true ); From 1e520949b8279706cd19bc4e2972955eddba33a6 Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Wed, 28 Feb 2024 18:36:06 +0530 Subject: [PATCH 2/2] Update index.js --- src/OnboardingSPA/components/StartOptions/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js index 476198046..2c9918619 100644 --- a/src/OnboardingSPA/components/StartOptions/index.js +++ b/src/OnboardingSPA/components/StartOptions/index.js @@ -29,7 +29,6 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => { updateDesignRoutes, updateInitialize, setCurrentOnboardingData, - setContinueWithoutAi, } = useDispatch( nfdOnboardingStore ); const switchFlow = ( newFlow ) => {