Skip to content

Commit

Permalink
return false for isEligible if no icon block
Browse files Browse the repository at this point in the history
if icon label is modified and does not have icon block, isEligible returns an error
  • Loading branch information
mxkae committed Nov 14, 2024
1 parent 74c0af7 commit 2c00470
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/block/icon-label/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const deprecated = [
attributes: attributes( '3.13.1' ),
save: withVersion( '3.13.1' )( Save ),
isEligible: ( attributes, innerBlocks ) => {
if ( innerBlocks[ 0 ]?.name !== 'stackable/icon' ) {
return false
}

const iconBlockAttributes = innerBlocks[ 0 ].attributes
const hasIconSize = iconBlockAttributes.iconSize || iconBlockAttributes.iconSizeTablet || iconBlockAttributes.iconSizeMobile ? true : false
const hasIconGap = attributes.iconGap || attributes.iconGapTablet || attributes.iconGapMobile ? true : false
Expand Down

0 comments on commit 2c00470

Please sign in to comment.