feat: enhance image loading and socket handling in Product and Images components, and update prerender logic in App and ProductDetailPage
This commit is contained in:
@@ -20,7 +20,7 @@ class CartItem extends Component {
|
||||
this.setState({image:window.tinyPicCache[picid],loading:false, error: false})
|
||||
}else{
|
||||
this.setState({image: null, loading: true, error: false});
|
||||
if(this.props.socket){
|
||||
if(this.props.socket && this.props.socket.connected){
|
||||
this.props.socket.emit('getPic', { bildId:picid, size:'tiny' }, (res) => {
|
||||
if(res.success){
|
||||
window.tinyPicCache[picid] = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/jpeg' }));
|
||||
|
||||
Reference in New Issue
Block a user