From f0886144afcc37a2e114b92977a2ec5b37ddc68b Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 19 Feb 2024 07:38:11 +0400 Subject: [PATCH] BlockSettingsMenu: Combine 'block-editor' store selectors (#59153) Co-authored-by: Mamaduka Co-authored-by: andrewserong --- .../block-settings-menu/block-settings-dropdown.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js index 657d685b966e07..e74dcfe329e43d 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js +++ b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js @@ -98,6 +98,7 @@ export function BlockSettingsDropdown( { parentBlockType, previousBlockClientId, selectedBlockClientIds, + openedBlockSettingsMenu, } = useSelect( ( select ) => { const { @@ -107,7 +108,8 @@ export function BlockSettingsDropdown( { getPreviousBlockClientId, getSelectedBlockClientIds, getBlockAttributes, - } = select( blockEditorStore ); + getOpenedBlockSettingsMenu, + } = unlock( select( blockEditorStore ) ); const { getActiveBlockVariation } = select( blocksStore ); @@ -129,6 +131,7 @@ export function BlockSettingsDropdown( { previousBlockClientId: getPreviousBlockClientId( firstBlockClientId ), selectedBlockClientIds: getSelectedBlockClientIds(), + openedBlockSettingsMenu: getOpenedBlockSettingsMenu(), }; }, [ firstBlockClientId ] @@ -136,12 +139,6 @@ export function BlockSettingsDropdown( { const { getBlockOrder, getSelectedBlockClientIds } = useSelect( blockEditorStore ); - const openedBlockSettingsMenu = useSelect( - ( select ) => - unlock( select( blockEditorStore ) ).getOpenedBlockSettingsMenu(), - [] - ); - const { setOpenedBlockSettingsMenu } = unlock( useDispatch( blockEditorStore ) );