Skip to content

Commit

Permalink
fix (icon block): deprecation error, return false for isEligible if n…
Browse files Browse the repository at this point in the history
…o icon block (#3368)

if icon label is modified and does not have icon block, isEligible returns an error
  • Loading branch information
mxkae authored Nov 14, 2024
1 parent 462c689 commit 92f2579
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 92f2579

Please sign in to comment.