Skip to content

Commit

Permalink
Removed unecessary requests from the gallery.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Apr 23, 2018
1 parent cb1b92e commit 1ba505a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blocks/library/gallery/gallery-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class GalleryImage extends Component {
}
}

componentWillReceiveProps( { isSelected, image, url } ) {
if ( image && ! url ) {
componentWillReceiveProps( { isSelected, image } ) {
if ( image ) {
this.props.setAttributes( {
url: image.source_url,
alt: image.alt_text,
Expand Down Expand Up @@ -150,9 +150,9 @@ class GalleryImage extends Component {

export default withSelect( ( select, ownProps ) => {
const { getMedia } = select( 'core' );
const { id } = ownProps;
const { id, url } = ownProps;

return {
image: id ? getMedia( id ) : null,
image: id && ! url ? getMedia( id ) : null,
};
} )( GalleryImage );

0 comments on commit 1ba505a

Please sign in to comment.