Lazy loader loading indicator
This commit is contained in:
@ -29,7 +29,6 @@ class LibraryAlbums extends React.Component{
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
if( !this.props.library_albums_more ) return
|
||||
this.props.spotifyActions.getURL( this.props.library_albums_more, 'SPOTIFY_LIBRARY_ALBUMS_LOADED' );
|
||||
}
|
||||
|
||||
@ -173,7 +172,7 @@ class LibraryAlbums extends React.Component{
|
||||
<div className="view library-albums-view">
|
||||
<Header icon="cd" title="My albums" actions={actions} />
|
||||
{ this.renderView(albums) }
|
||||
<LazyLoadListener loadMore={ () => this.loadMore() }/>
|
||||
<LazyLoadListener enabled={this.props.library_albums_more} loadMore={ () => this.loadMore() }/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ class LibraryArtists extends React.Component{
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
if( !this.props.library_artists_more ) return
|
||||
this.props.spotifyActions.getURL( this.props.library_artists_more, 'SPOTIFY_LIBRARY_ARTISTS_LOADED' );
|
||||
}
|
||||
|
||||
@ -127,7 +126,7 @@ class LibraryArtists extends React.Component{
|
||||
<div className="view library-artists-view">
|
||||
<Header icon="mic" title="My artists" actions={actions} />
|
||||
{ this.renderView(artists) }
|
||||
<LazyLoadListener loadMore={ () => this.loadMore() }/>
|
||||
<LazyLoadListener enabled={this.props.library_artists_more} loadMore={ () => this.loadMore() }/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ class LibraryLocalAlbums extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
moreURIsToLoad(){
|
||||
var uris = []
|
||||
if (this.props.albums && this.props.local_albums){
|
||||
for (var i = 0; i < this.props.local_albums.length; i++){
|
||||
@ -50,7 +50,12 @@ class LibraryLocalAlbums extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
if (uris && uris.length > 0) this.props.mopidyActions.getAlbums(uris)
|
||||
return uris
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
var uris = this.moreURIsToLoad()
|
||||
this.props.mopidyActions.getAlbums(uris)
|
||||
}
|
||||
|
||||
setSort(value){
|
||||
@ -147,7 +152,7 @@ class LibraryLocalAlbums extends React.Component{
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local albums" actions={actions} />
|
||||
{this.renderView(albums)}
|
||||
<LazyLoadListener loadMore={ () => this.loadMore() }/>
|
||||
<LazyLoadListener enabled={(this.moreURIsToLoad().length > 0)} loadMore={ () => this.loadMore() }/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -23,7 +23,6 @@ class LibraryTracks extends React.Component{
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
if( !this.props.tracks_more ) return
|
||||
this.props.spotifyActions.getURL( this.props.tracks_more, 'SPOTIFY_LIBRARY_TRACKS_LOADED_MORE' );
|
||||
}
|
||||
|
||||
@ -33,7 +32,7 @@ class LibraryTracks extends React.Component{
|
||||
<Header icon="music" title="My tracks" />
|
||||
<section className="list-wrapper">
|
||||
{ this.props.tracks ? <TrackList tracks={this.props.tracks} /> : null }
|
||||
<LazyLoadListener loadMore={ () => this.loadMore() }/>
|
||||
<LazyLoadListener enabled={this.props.tracks_more} loadMore={ () => this.loadMore() }/>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user