diff --git a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js index fc74b3624..78e54bbde 100644 --- a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js +++ b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js @@ -16,9 +16,19 @@ 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 { siteGenErrorStatus } = useSelect( ( select ) => { + return { + siteGenErrorStatus: + select( nfdOnboardingStore ).getSiteGenErrorStatus(), + }; + } ); const navigate = useNavigate(); const navigateBack = () => { + 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 553c98510..69a4cba8a 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -100,6 +100,7 @@ const SiteGen = () => { identifier, skipCache ); + if ( data.body !== null ) { currentData.sitegen.siteGenMetaStatus.currentStatus += 1; if ( @@ -112,15 +113,14 @@ const SiteGen = () => { } } catch ( err ) { if ( retryCount < MAX_RETRIES_SITE_GEN ) { - performSiteGenMetaGeneration( + return performSiteGenMetaGeneration( siteInfo, identifier, skipCache, retryCount + 1 ); - } else { - updateSiteGenErrorStatus( true ); } + updateSiteGenErrorStatus( true ); } }