Skip to content

Commit

Permalink
Remove hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Oct 18, 2024
1 parent a6425e6 commit 0d08470
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1595,18 +1595,8 @@ const isBlockVisibleInTheInserter = (
checkedBlocks.add( blockName );

// If parent blocks are not visible, child blocks should be hidden too.
//
// In some scenarios, blockType.parent may be a string.
// A better approach would be sanitize parent in all the places that can be modified:
// block registration, processBlockType, filters, etc.
// In the meantime, this is a hotfix to prevent the editor from crashing.
const parent =
typeof blockType.parent === 'string' ||
blockType.parent instanceof String
? [ blockType.parent ]
: blockType.parent;
if ( Array.isArray( parent ) ) {
return parent.some(
if ( Array.isArray( blockType.parent ) ) {
return blockType.parent.some(
( name ) =>
( blockName !== name &&
isBlockVisibleInTheInserter(
Expand Down

0 comments on commit 0d08470

Please sign in to comment.