Loading artwork on render of GridItem, regardless of URI type; fixes #321

This commit is contained in:
James Barnsley
2018-08-24 15:42:47 +12:00
parent c734dd7fe5
commit 1cbe7ed3ad
8 changed files with 70 additions and 73 deletions

View File

@ -17,6 +17,12 @@ class ArtistGrid extends React.Component{
super(props);
}
itemMounted(item){
if (!item.images){
this.props.lastfmActions.getArtist(item.uri, item.name);
}
}
handleContextMenu(e,item){
console.log(item);
e.preventDefault();
@ -47,9 +53,9 @@ class ArtistGrid extends React.Component{
item={artist}
show_source_icon={this.props.show_source_icon}
onClick={e => {hashHistory.push(global.baseURL+'artist/'+encodeURIComponent(artist.uri))}}
onLoad={() => this.handleLoad(artist.uri)}
lastfmActions={this.props.lastfmActions}
onContextMenu={e => this.handleContextMenu(e,artist)}
onMount={() => this.itemMounted(artist)}
/>
)
}