Skip to content

Commit

Permalink
Update buildBlockTypeItem to correctly fetch block type variations
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Sep 17, 2021
1 parent f23cf62 commit e10d0fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import createSelector from 'rememo';
import {
getBlockType,
getBlockTypes,
getBlockVariations,
hasBlockSupport,
getPossibleBlockTransformations,
parse,
Expand Down Expand Up @@ -1514,9 +1515,7 @@ const buildBlockTypeItem = ( state, { buildScope = 'inserter' } ) => (
};
if ( buildScope === 'transform' ) return blockItemBase;

const inserterVariations = blockType.variations.filter(
( { scope } ) => ! scope || scope.includes( 'inserter' )
);
const inserterVariations = getBlockVariations( blockType.name, 'inserter' );
return {
...blockItemBase,
initialAttributes: {},
Expand Down

0 comments on commit e10d0fc

Please sign in to comment.