Skip to content

Commit

Permalink
refactored name from currentData to flowData
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod committed Aug 23, 2022
1 parent 0534425 commit dd63813
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/OnboardingSPA/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const App = () => {
}

async function syncStoreToDB() {
if ( currentData ){
if ( flowData ){
if (didVisitEcommerce) {
await syncStoreDetails();
}
Expand Down
6 changes: 3 additions & 3 deletions src/OnboardingSPA/pages/Steps/BasicInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ const StepBasicInfo = () => {
const { enqueueRequest, flushQueue, setIsDrawerOpened, setDrawerActiveView, setIsSidebarOpened, setIsDrawerSuppressed } =
useDispatch( nfdOnboardingStore );

const { currentStep, currentData } = useSelect(
const { currentStep, flowData } = useSelect(
(select) => {
return {
currentStep: select(nfdOnboardingStore).getCurrentStep(),
currentData: select(nfdOnboardingStore).getCurrentOnboardingData()
flowData: select(nfdOnboardingStore).getCurrentOnboardingFlowData()
};
},
[]
);

useEffect( () => {
flushQueue(currentData);
flushQueue(flowData);
enqueueRequest(FLOW_SYNC);
enqueueRequest(SETTINGS_SYNC);
if ( isLargeViewport ) {
Expand Down
6 changes: 3 additions & 3 deletions src/OnboardingSPA/pages/Steps/DesignThemes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ const StepDesignThemes = () => {
const { flushQueue, setDrawerActiveView, setIsDrawerOpened, setIsSidebarOpened } =
useDispatch( nfdOnboardingStore );

const { currentData } = useSelect((select) => {
const { flowData } = useSelect((select) => {
return {
currentData: select(nfdOnboardingStore).getCurrentOnboardingData()
flowData: select(nfdOnboardingStore).getCurrentOnboardingFlowData()
};
}, []);

useEffect( () => {
flushQueue(currentData);
flushQueue(flowData);
setIsSidebarOpened( false );
setIsDrawerOpened( true );
setDrawerActiveView( VIEW_DESIGN_THEMES );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const StepAddress = () => {
} = useDispatch(nfdOnboardingStore);

useEffect(() => {
flushQueue(currentData);
flushQueue(flowData);
if (isLargeViewport) {
setIsDrawerOpened(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const StepProducts = () => {
);
let productInfo = flowData.storeDetails.productInfo;
useEffect(() => {
flushQueue(currentData);
flushQueue(flowData);
if (isLargeViewport) {
setIsDrawerOpened(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const StepTax = () => {
);

useEffect(() => {
flushQueue(currentData);
flushQueue(flowData);
if (isLargeViewport) {
setIsDrawerOpened(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const GetStartedExperience = () => {
} = useDispatch( nfdOnboardingStore );

useEffect( () => {
flushQueue(currentData);
flushQueue(flowData);
enqueueRequest(FLOW_SYNC);
setIsSidebarOpened( false );
setIsDrawerSuppressed( true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const StepPrimarySetup = () => {
);

useEffect(() => {
flushQueue(currentData);
flushQueue(flowData);
enqueueRequest(FLOW_SYNC);
setIsSidebarOpened(false);
setIsDrawerSuppressed(true);
Expand Down
6 changes: 3 additions & 3 deletions src/OnboardingSPA/pages/Steps/GetStarted/Welcome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import { VIEW_NAV_GET_STARTED } from '../../../../../constants';
*/
const StepWelcome = () => {
const location = useLocation();
const { currentStep, currentData, brandName } = useSelect(
const { currentStep, flowData, brandName } = useSelect(
(select) => {
return {
currentStep: select(nfdOnboardingStore).getCurrentStep(),
currentData: select(nfdOnboardingStore).getCurrentOnboardingData(),
flowData: select(nfdOnboardingStore).getCurrentOnboardingFlowData(),
brandName: select(nfdOnboardingStore).getNewfoldBrandName(),
};
},
Expand All @@ -40,7 +40,7 @@ const StepWelcome = () => {
} = useDispatch( nfdOnboardingStore );

useEffect( () => {
flushQueue(currentData);
flushQueue(flowData);
setIsSidebarOpened( false );
setIsDrawerSuppressed( true );
setDrawerActiveView( VIEW_NAV_GET_STARTED );
Expand Down
2 changes: 1 addition & 1 deletion src/OnboardingSPA/pages/Steps/TopPriority/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const StepTopPriority = ( props ) => {
};

useEffect( () => {
flushQueue(currentData);
flushQueue(flowData);
enqueueRequest(FLOW_SYNC);
if ( isLargeViewport ) {
setIsDrawerOpened( true );
Expand Down

0 comments on commit dd63813

Please sign in to comment.