Skip to content

Commit

Permalink
Stepper: Fix 404 error (#97407)
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero authored Dec 12, 2024
1 parent 8c0021b commit 3ef16d5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions client/landing/stepper/hooks/use-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ export function useSite() {

// Request the site for the redux store
useEffect( () => {
dispatch( ( d, getState ) => {
const state = getState();
if ( getSite( state, siteIdOrSlug ) || isRequestingSite( state, siteIdOrSlug ) ) {
return;
}
d( requestSite( siteIdOrSlug ) );
} );
if ( siteIdOrSlug ) {
dispatch( ( d, getState ) => {
const state = getState();
if ( getSite( state, siteIdOrSlug ) || isRequestingSite( state, siteIdOrSlug ) ) {
return;
}
d( requestSite( siteIdOrSlug ) );
} );
}
}, [ dispatch, siteIdOrSlug ] );

if ( siteIdOrSlug && site ) {
Expand Down

0 comments on commit 3ef16d5

Please sign in to comment.