Skip to content

Commit

Permalink
Fix the site editor loading in multi-site installs (#49861)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and bph committed Apr 19, 2023
1 parent 3e039ef commit fc29702
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ import { store as editSiteStore } from '../../store';
export default function useInitEditedEntityFromURL() {
const { params: { postId, postType } = {} } = useLocation();
const { isRequestingSite, homepageId, url } = useSelect( ( select ) => {
const { getSite } = select( coreDataStore );
const { getSite, getUnstableBase } = select( coreDataStore );
const siteData = getSite();
const base = getUnstableBase();

return {
isRequestingSite: ! siteData,
isRequestingSite: ! base,
homepageId:
siteData?.show_on_front === 'page'
? siteData.page_on_front
: null,
url: siteData?.url,
url: base?.home,
};
}, [] );

Expand Down

1 comment on commit fc29702

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in fc29702.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4741284001
📝 Reported issues:

Please sign in to comment.