From 586ecf45c8f7353afe272ce60a7b3aaf4393fa07 Mon Sep 17 00:00:00 2001 From: scruffian Date: Thu, 9 Feb 2023 11:20:02 +0000 Subject: [PATCH] still check for draft menus --- .../src/navigation/edit/unsaved-inner-blocks.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/navigation/edit/unsaved-inner-blocks.js b/packages/block-library/src/navigation/edit/unsaved-inner-blocks.js index 98a16a5b2c06bb..6e1981ff1b9dbd 100644 --- a/packages/block-library/src/navigation/edit/unsaved-inner-blocks.js +++ b/packages/block-library/src/navigation/edit/unsaved-inner-blocks.js @@ -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 @@ -144,8 +151,8 @@ export default function UnsavedInnerBlocks( { isSaving, hasResolvedDraftNavigationMenus, hasResolvedNavigationMenus, - hasSelection, innerBlocksAreDirty, + hasSelection, ] ); const Wrapper = isSaving ? Disabled : 'div';