Skip to content

Commit 92f2579

Browse files
authored
fix (icon block): deprecation error, return false for isEligible if no icon block (#3368)
if icon label is modified and does not have icon block, isEligible returns an error
1 parent 462c689 commit 92f2579

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/block/icon-label/deprecated.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const deprecated = [
1212
attributes: attributes( '3.13.1' ),
1313
save: withVersion( '3.13.1' )( Save ),
1414
isEligible: ( attributes, innerBlocks ) => {
15+
if ( innerBlocks[ 0 ]?.name !== 'stackable/icon' ) {
16+
return false
17+
}
18+
1519
const iconBlockAttributes = innerBlocks[ 0 ].attributes
1620
const hasIconSize = iconBlockAttributes.iconSize || iconBlockAttributes.iconSizeTablet || iconBlockAttributes.iconSizeMobile ? true : false
1721
const hasIconGap = attributes.iconGap || attributes.iconGapTablet || attributes.iconGapMobile ? true : false

0 commit comments

Comments
 (0)