From f8aabf09167fa81e1b3660361eedb24f36a5ec7e Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Thu, 5 Dec 2024 14:43:11 +0200 Subject: [PATCH] use getSelectedBlockCount --- .../components/multi-selection-inspector/index.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/block-editor/src/components/multi-selection-inspector/index.js b/packages/block-editor/src/components/multi-selection-inspector/index.js index 525baa4f22223e..23d890d79fff4d 100644 --- a/packages/block-editor/src/components/multi-selection-inspector/index.js +++ b/packages/block-editor/src/components/multi-selection-inspector/index.js @@ -13,12 +13,10 @@ import BlockIcon from '../block-icon'; import { store as blockEditorStore } from '../../store'; export default function MultiSelectionInspector() { - const { blocks } = useSelect( ( select ) => { - const { getMultiSelectedBlocks } = select( blockEditorStore ); - return { - blocks: getMultiSelectedBlocks(), - }; - }, [] ); + const selectedBlockCount = useSelect( + ( select ) => select( blockEditorStore ).getSelectedBlockCount(), + [] + ); return ( { sprintf( /* translators: %d: number of blocks */ - _n( '%d Block', '%d Blocks', blocks.length ), - blocks.length + _n( '%d Block', '%d Blocks', selectedBlockCount ), + selectedBlockCount ) }