From 9bff41805925514c7c5dbb128ec9572ef93f4795 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 28 Sep 2023 11:17:33 +0530 Subject: [PATCH] add loader --- .../components/StateHandlers/Flow/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/OnboardingSPA/components/StateHandlers/Flow/index.js b/src/OnboardingSPA/components/StateHandlers/Flow/index.js index e88251704..d3f79a27d 100644 --- a/src/OnboardingSPA/components/StateHandlers/Flow/index.js +++ b/src/OnboardingSPA/components/StateHandlers/Flow/index.js @@ -60,6 +60,10 @@ const FlowStateHandler = ( { children } ) => { updateDesignRoutes, setCurrentOnboardingData, setActiveChapter, + setIsDrawerOpened, + setIsDrawerSuppressed, + setIsHeaderNavigationEnabled, + setSidebarActiveView, } = useDispatch( nfdOnboardingStore ); const handleCommerceFlow = async ( flow, retries = 0 ) => { @@ -176,9 +180,18 @@ const FlowStateHandler = ( { children } ) => { trackChapters(); }, [ currentStep ] ); + const disableNavigation = () => { + setIsDrawerOpened( false ); + setIsDrawerSuppressed( true ); + setIsHeaderNavigationEnabled( false ); + setSidebarActiveView( false ); + }; + useEffect( () => { if ( window.nfdOnboarding?.newFlow ) { const flow = window.nfdOnboarding.newFlow; + disableNavigation(); + setNewFlow( flow ); switchToNewFlow( flow ); window.nfdOnboarding.newFlow = undefined; }