Skip to content

Commit

Permalink
use getSelectedBlockCount
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Dec 5, 2024
1 parent f6bea5d commit f8aabf0
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<HStack
justify="flex-start"
Expand All @@ -29,8 +27,8 @@ export default function MultiSelectionInspector() {
<div className="block-editor-multi-selection-inspector__card-title">
{ sprintf(
/* translators: %d: number of blocks */
_n( '%d Block', '%d Blocks', blocks.length ),
blocks.length
_n( '%d Block', '%d Blocks', selectedBlockCount ),
selectedBlockCount
) }
</div>
</HStack>
Expand Down

0 comments on commit f8aabf0

Please sign in to comment.