From 1eb4fd8a1df71c37fd7c2ff78d21b759647822ef Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Mon, 12 Feb 2024 15:48:58 +0530 Subject: [PATCH 1/4] Fix Error page next button mobile view --- .../Header/components/SiteGenHeader/step-navigation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js index fc74b3624..7ddac67f1 100644 --- a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js +++ b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js @@ -16,9 +16,11 @@ import { stepSiteGenSiteLogo } from '../../../../steps/SiteGen/SiteLogo/step'; * @return {WPComponent} Back Component */ const Back = ( { path, showErrorDialog } ) => { - const { setNavErrorContinuePath } = useDispatch( nfdOnboardingStore ); + const { setNavErrorContinuePath, updateSiteGenErrorStatus } = + useDispatch( nfdOnboardingStore ); const navigate = useNavigate(); const navigateBack = () => { + updateSiteGenErrorStatus( false ); if ( showErrorDialog !== false ) { setNavErrorContinuePath( path ); } else { From 170c529d6ec22e05990623f268e70352f3a08735 Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Tue, 13 Feb 2024 17:36:01 +0530 Subject: [PATCH 2/4] fixed issues with error state --- .../components/SiteGenHeader/step-navigation.js | 10 +++++++++- .../NewfoldInterfaceSkeleton/SiteGen/index.js | 13 +++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js index 7ddac67f1..78e54bbde 100644 --- a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js +++ b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js @@ -18,9 +18,17 @@ import { stepSiteGenSiteLogo } from '../../../../steps/SiteGen/SiteLogo/step'; const Back = ( { path, showErrorDialog } ) => { const { setNavErrorContinuePath, updateSiteGenErrorStatus } = useDispatch( nfdOnboardingStore ); + const { siteGenErrorStatus } = useSelect( ( select ) => { + return { + siteGenErrorStatus: + select( nfdOnboardingStore ).getSiteGenErrorStatus(), + }; + } ); const navigate = useNavigate(); const navigateBack = () => { - updateSiteGenErrorStatus( false ); + if ( siteGenErrorStatus === true ) { + updateSiteGenErrorStatus( false ); + } if ( showErrorDialog !== false ) { setNavErrorContinuePath( path ); } else { diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js index 1b28cdd1c..bd039272b 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -93,6 +93,7 @@ const SiteGen = () => { identifier, skipCache ); + if ( data.body !== null ) { currentData.sitegen.siteGenMetaStatus.currentStatus += 1; if ( @@ -105,15 +106,15 @@ const SiteGen = () => { } } catch ( err ) { if ( retryCount < MAX_RETRIES_SITE_GEN ) { - performSiteGenMetaGeneration( + return performSiteGenMetaGeneration( siteInfo, identifier, skipCache, retryCount + 1 ); - } else { - updateSiteGenErrorStatus( true ); } + currentData.sitegen.siteGenErrorStatus = true; + updateSiteGenErrorStatus( true ); } } @@ -181,7 +182,11 @@ const SiteGen = () => { }, [ location.pathname ] ); useEffect( () => { - if ( prevSiteGenErrorStatus.current === true && siteGenErrorStatus === false ) { + if ( + prevSiteGenErrorStatus.current === true && + siteGenErrorStatus === false + ) { + console.log("am called"); generateSiteGenData(); syncStoreToDB(); } From a4f6800a593e3a308f292f45da3b8c4a2d7d25c9 Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Tue, 13 Feb 2024 17:38:03 +0530 Subject: [PATCH 3/4] Update index.js --- .../components/NewfoldInterfaceSkeleton/SiteGen/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js index bd039272b..deebf697d 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -186,7 +186,6 @@ const SiteGen = () => { prevSiteGenErrorStatus.current === true && siteGenErrorStatus === false ) { - console.log("am called"); generateSiteGenData(); syncStoreToDB(); } From cebd40734740bf35200494be9077f28bc7cb0f2c Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Wed, 21 Feb 2024 19:13:30 +0530 Subject: [PATCH 4/4] Update index.js --- .../components/NewfoldInterfaceSkeleton/SiteGen/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js index deebf697d..acce8ae5e 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -113,7 +113,6 @@ const SiteGen = () => { retryCount + 1 ); } - currentData.sitegen.siteGenErrorStatus = true; updateSiteGenErrorStatus( true ); } }