Skip to content

Commit

Permalink
Merge pull request #455 from newfold-labs/siteErrorPreviewFix
Browse files Browse the repository at this point in the history
Fixed the retry issue in preview page
  • Loading branch information
girish-lokapure authored Feb 8, 2024
2 parents 8f07296 + b9bc1b1 commit 7d4e4eb
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/OnboardingSPA/steps/SiteGen/Preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ const SiteGenPreview = () => {
updateSiteGenErrorStatus,
} = useDispatch( nfdOnboardingStore );

const { currentData, nextStep } = useSelect( ( select ) => {
return {
currentData:
select( nfdOnboardingStore ).getCurrentOnboardingData(),
nextStep: select( nfdOnboardingStore ).getNextStep(),
};
} );
const { currentData, nextStep, siteGenErrorStatus } = useSelect(
( select ) => {
return {
currentData:
select( nfdOnboardingStore ).getCurrentOnboardingData(),
nextStep: select( nfdOnboardingStore ).getNextStep(),
siteGenErrorStatus:
select( nfdOnboardingStore ).getSiteGenErrorStatus(),
};
}
);

useEffect( () => {
setIsHeaderEnabled( true );
Expand All @@ -49,6 +53,10 @@ const SiteGenPreview = () => {
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
updateInitialize( true );
if ( ! siteGenErrorStatus ) {
loadHomepages();
loadGlobalStyles();
}
}, [ currentData ] );

Check warning on line 60 in src/OnboardingSPA/steps/SiteGen/Preview/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'loadHomepages', 'setDrawerActiveView', 'setHeaderActiveView', 'setHideFooterNav', 'setIsHeaderEnabled', 'setSidebarActiveView', 'siteGenErrorStatus', and 'updateInitialize'. Either include them or remove the dependency array

const loadHomepages = async () => {
Expand Down

0 comments on commit 7d4e4eb

Please sign in to comment.