Patching thumbnail bug

This commit is contained in:
James Barnsley
2018-11-12 16:27:53 +13:00
parent f5291a9786
commit 190ab95737
4 changed files with 2 additions and 56 deletions

View File

@ -14,33 +14,6 @@ class Thumbnail extends React.Component{
constructor(props){
super(props);
}
/*
// TODO: ascertain whether this is improving or hindering performance
// The UI appears to work perfectly fine without this
shouldComponentUpdate(nextProps, nextState){
// no images at all, and we already know it
if (!nextProps.image && !this.props.image && !nextProps.images && !this.props.images) return false
// image changed
if (!this.props.image && nextProps.image) return true
if (this.props.image && nextProps.image) return true
if (this.props.image != nextProps.image) return true
// images array changed
if (this.props.images === undefined && nextProps.images ) return true
if (this.props.images && nextProps.images === undefined) return true
if (this.props.images && !nextProps.images || this.props.images.length != nextProps.images.length ) return true
// image item changed
var size = 'medium'
var images = helpers.sizedImages(nextProps.images )
if (this.props.size ) size = this.props.size
if (this.props.images[size] != images[size]) return true
return false
}
*/
mapImageSizes(){