diff --git a/src/OnboardingSPA/components/App/index.js b/src/OnboardingSPA/components/App/index.js index 422a6fbfc..dcf27834a 100644 --- a/src/OnboardingSPA/components/App/index.js +++ b/src/OnboardingSPA/components/App/index.js @@ -71,7 +71,9 @@ const App = () => { const initialData = await getSettings(); const result = await setSettings( socialData ); setDidVisitBasicInfo( false ); - if ( result?.error !== null ) return initialData?.body; + if ( result?.error !== null ) { + return initialData?.body; + } return result?.body; } @@ -122,8 +124,9 @@ const App = () => { const socialDataResp = await syncSocialSettings(); // If Social Data is changed then Sync that also to the store - if ( socialDataResp ) + if ( socialDataResp ) { setOnboardingSocialData( socialDataResp ); + } } const result = await setFlow( currentData ); @@ -136,8 +139,9 @@ const App = () => { } } // Check if the Basic Info page was visited - if ( location?.pathname.includes( 'basic-info' ) ) + if ( location?.pathname.includes( 'basic-info' ) ) { setDidVisitBasicInfo( true ); + } if ( location?.pathname.includes( 'ecommerce' ) ) { setDidVisitEcommerce( true ); } diff --git a/src/OnboardingSPA/components/ExitToWordPress/index.js b/src/OnboardingSPA/components/ExitToWordPress/index.js index 56685af5c..a68bae7b6 100644 --- a/src/OnboardingSPA/components/ExitToWordPress/index.js +++ b/src/OnboardingSPA/components/ExitToWordPress/index.js @@ -85,7 +85,9 @@ const ExitToWordPress = ( { const socialDataResp = await syncSocialSettingsFinish(); // If Social Data is changed then Sync that also to the store - if ( socialDataResp ) setOnboardingSocialData( socialDataResp ); + if ( socialDataResp ) { + setOnboardingSocialData( socialDataResp ); + } } setFlow( currentData ); } diff --git a/src/OnboardingSPA/components/SkipButton/index.js b/src/OnboardingSPA/components/SkipButton/index.js index b5ff34eb3..052f22c85 100644 --- a/src/OnboardingSPA/components/SkipButton/index.js +++ b/src/OnboardingSPA/components/SkipButton/index.js @@ -32,7 +32,9 @@ const SkipButton = () => { async function syncSocialSettingsFinish() { const initialData = await getSettings(); const result = await setSettings( socialData ); - if ( result?.error !== null ) return initialData?.body; + if ( result?.error !== null ) { + return initialData?.body; + } return result?.body; } @@ -45,7 +47,9 @@ const SkipButton = () => { const socialDataResp = await syncSocialSettingsFinish(); // If Social Data is changed then Sync that also to the store - if ( socialDataResp ) setOnboardingSocialData( socialDataResp ); + if ( socialDataResp ) { + setOnboardingSocialData( socialDataResp ); + } } setFlow( currentData ); } diff --git a/src/OnboardingSPA/pages/Steps/BasicInfo/basicInfoForm.js b/src/OnboardingSPA/pages/Steps/BasicInfo/basicInfoForm.js index 561275252..724d9cf62 100644 --- a/src/OnboardingSPA/pages/Steps/BasicInfo/basicInfoForm.js +++ b/src/OnboardingSPA/pages/Steps/BasicInfo/basicInfoForm.js @@ -67,7 +67,9 @@ const BasicInfoForm = () => { } useEffect( () => { - if ( isSocialFormOpen ) socialMediaRef.current.scrollIntoView(); + if ( isSocialFormOpen ) { + socialMediaRef.current.scrollIntoView(); + } }, [ isSocialFormOpen ] ); useEffect( () => { @@ -79,7 +81,9 @@ const BasicInfoForm = () => { setisLoaded( true ); setOnboardingSocialData( socialDataAPI?.body ); } - if ( ! isLoaded ) getFlowData(); + if ( ! isLoaded ) { + getFlowData(); + } getEditedEntityRecord( 'root', 'site' ); setDefaultData(); @@ -87,7 +91,9 @@ const BasicInfoForm = () => { useEffect( () => { const timerId = setTimeout( () => { - if ( isLoaded ) setDebouncedFlowData( createSaveData() ); + if ( isLoaded ) { + setDebouncedFlowData( createSaveData() ); + } }, 600 ); return () => { @@ -125,7 +131,9 @@ const BasicInfoForm = () => { debouncedFlowData.data.socialData ?? socialData ); }; - if ( debouncedFlowData ) saveData(); + if ( debouncedFlowData ) { + saveData(); + } }, [ debouncedFlowData ] ); return (