From fef305e6eeac0974536dad1123034cb02f888cab Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 1 Feb 2024 17:55:37 +0530 Subject: [PATCH] Use cache unless prompt changes --- .../components/NewfoldInterfaceSkeleton/SiteGen/index.js | 7 +++++++ src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js | 1 + 2 files changed, 8 insertions(+) diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js index 8b0b3f8c1..74f059d87 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -73,6 +73,13 @@ const SiteGen = () => { .then( ( data ) => { if ( data.body !== null ) { currentData.sitegen.siteGenMetaStatus.currentStatus += 1; + if ( + currentData.sitegen.siteGenMetaStatus + .currentStatus === + currentData.sitegen.siteGenMetaStatus.totalCount + ) { + currentData.sitegen.skipCache = false; + } setCurrentOnboardingData( currentData ); } else if ( retryCount < MAX_RETRIES_SITE_GEN ) { performSiteGenMetaGeneration( diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js b/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js index cbf730246..83a2f043c 100644 --- a/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js +++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js @@ -49,6 +49,7 @@ const SiteGenSiteDetails = () => { useEffect( () => { if ( + customerInput !== undefined && customerInput !== '' && customerInput !== currentData.sitegen.siteDetails.prompt ) {