Skip to content

Commit

Permalink
Fix the site editor home page loading when installed in a subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 23, 2023
1 parent c74672c commit 875082a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { store as editSiteStore } from '../../store';

export default function useInitEditedEntityFromURL() {
const { params: { postId, postType } = {} } = useLocation();
const { isRequestingSite, homepageId } = useSelect( ( select ) => {
const { isRequestingSite, homepageId, url } = useSelect( ( select ) => {
const { getSite } = select( coreDataStore );
const siteData = getSite();

Expand All @@ -23,6 +23,7 @@ export default function useInitEditedEntityFromURL() {
siteData?.show_on_front === 'page'
? siteData.page_on_front
: null,
url: siteData?.url,
};
}, [] );

Expand Down Expand Up @@ -60,10 +61,11 @@ export default function useInitEditedEntityFromURL() {
} );
} else if ( ! isRequestingSite ) {
setPage( {
path: '/',
path: url,
} );
}
}, [
url,
postId,
postType,
homepageId,
Expand Down

0 comments on commit 875082a

Please sign in to comment.