Skip to content

Commit

Permalink
Use standard getEntityRecords and remove custom entity selector
Browse files Browse the repository at this point in the history
Now moved to #39498
  • Loading branch information
getdave committed Mar 21, 2022
1 parent 2aa66a4 commit 54aa5b9
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ export default function NavigationInspector() {
getBlock,
} = select( blockEditorStore );

const {
getNavigationMenus,
hasFinishedResolution,
isResolving,
} = select( coreStore );
const { getEntityRecords, hasFinishedResolution, isResolving } = select(
coreStore
);

const navigationMenusQuery = [
'postType',
'wp_navigation',
NAVIGATION_MENUS_QUERY[ 0 ],
];

// Get the active Navigation block (if present).
const selectedNavId = __experimentalGetActiveBlockIdByBlockNames(
Expand All @@ -57,14 +61,14 @@ export default function NavigationInspector() {
selectedNavigationBlockId: selectedNavId,
firstNavigationBlockId: navBlockIds?.[ 0 ],
clientIdToRef: idToRef,
navigationMenus: getNavigationMenus( NAVIGATION_MENUS_QUERY[ 0 ] ),
navigationMenus: getEntityRecords( ...navigationMenusQuery ),
isResolvingNavigationMenus: isResolving(
'getNavigationMenus',
NAVIGATION_MENUS_QUERY
'getEntityRecords',
navigationMenusQuery
),
hasResolvedNavigationMenus: hasFinishedResolution(
'getNavigationMenus',
NAVIGATION_MENUS_QUERY
'getEntityRecords',
navigationMenusQuery
),
};
}, [] );
Expand Down

0 comments on commit 54aa5b9

Please sign in to comment.