Skip to content

Commit

Permalink
still check for draft menus
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Feb 9, 2023
1 parent cd2b54f commit 586ecf4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/block-library/src/navigation/edit/unsaved-inner-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,18 @@ export default function UnsavedInnerBlocks( {
return EMPTY_OBJECT;
}

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

return {
isSaving: isSavingEntityRecord( 'postType', 'wp_navigation' ),
draftNavigationMenus: getEntityRecords(
// This is needed so that hasResolvedDraftNavigationMenus gives the correct status.
...DRAFT_MENU_PARAMS
),
hasResolvedDraftNavigationMenus: hasFinishedResolution(
'getEntityRecords',
DRAFT_MENU_PARAMS
Expand Down Expand Up @@ -144,8 +151,8 @@ export default function UnsavedInnerBlocks( {
isSaving,
hasResolvedDraftNavigationMenus,
hasResolvedNavigationMenus,
hasSelection,
innerBlocksAreDirty,
hasSelection,
] );

const Wrapper = isSaving ? Disabled : 'div';
Expand Down

0 comments on commit 586ecf4

Please sign in to comment.