Skip to content

Commit

Permalink
fix error on multi select
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed May 11, 2023
1 parent ee59699 commit c053a1e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { store as blockEditorStore } from '../../store';
import BlockIcon from '../block-icon';
import PreviewBlockPopover from './preview-block-popover';

const EMPTY_OBJECT = {};

export function useBlockVariationTransforms( { clientIds, blocks } ) {
const { activeBlockVariation, blockVariationTransformations } = useSelect(
( select ) => {
Expand All @@ -33,7 +35,7 @@ export function useBlockVariationTransforms( { clientIds, blocks } ) {
const canRemove = canRemoveBlocks( clientIds, rootClientId );
// Only handle single selected blocks for now.
if ( blocks.length !== 1 || ! canRemove ) {
return;
return EMPTY_OBJECT;
}
const [ firstBlock ] = blocks;
return {
Expand Down

0 comments on commit c053a1e

Please sign in to comment.