From 0e190769ff41250175984bca7310ccbad3d73735 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Tue, 30 Apr 2019 17:14:13 -0400 Subject: [PATCH] Check for `FocalPointPicker` before using it (compat for WP 5.1) --- assets/js/blocks/featured-product/block.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/blocks/featured-product/block.js b/assets/js/blocks/featured-product/block.js index de198b1b589..5d51da59b46 100644 --- a/assets/js/blocks/featured-product/block.js +++ b/assets/js/blocks/featured-product/block.js @@ -127,6 +127,7 @@ class FeaturedProduct extends Component { const url = attributes.mediaSrc || getImageSrcFromProduct( this.state.product ); + const { focalPoint = { x: 0.5, y: 0.5 } } = attributes; return ( @@ -160,11 +161,11 @@ class FeaturedProduct extends Component { max={ 100 } step={ 10 } /> - { url && + { !! FocalPointPicker && !! url && setAttributes( { focalPoint: value } ) } /> }