From fb9de19c836547a8803537bb114df112d12ff843 Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Tue, 27 Feb 2024 15:36:28 +0530 Subject: [PATCH] Update index.js --- src/OnboardingSPA/steps/TheFork/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/OnboardingSPA/steps/TheFork/index.js b/src/OnboardingSPA/steps/TheFork/index.js index ebd094ce5..a0cba9a21 100644 --- a/src/OnboardingSPA/steps/TheFork/index.js +++ b/src/OnboardingSPA/steps/TheFork/index.js @@ -48,7 +48,10 @@ const TheFork = () => { setCurrentOnboardingData, } = useDispatch( nfdOnboardingStore ); + const navigate = useNavigate(); + useEffect( () => { + checkHasAiAccess(); setHideFooterNav( true ); setIsHeaderEnabled( false ); setSidebarActiveView( false ); @@ -57,8 +60,8 @@ const TheFork = () => { setDrawerActiveView( false ); setFooterActiveView( FOOTER_SITEGEN ); } ); - const navigate = useNavigate(); - useEffect( () => { + + const checkHasAiAccess = () => { if ( false === validateFlow( brandConfig, SITEGEN_FLOW ) ) { const currentFlow = window.nfdOnboarding.currentFlow; const getData = resolveGetDataForFlow( DEFAULT_FLOW ); @@ -76,8 +79,7 @@ const TheFork = () => { updateInitialize( true ); navigate( data.steps[ 1 ].path ); } - } ); - + }; const oldFlow = window.nfdOnboarding?.oldFlow ? window.nfdOnboarding.oldFlow : DEFAULT_FLOW;