Lazy loading cleanup
This commit is contained in:
@ -183,7 +183,11 @@ class LibraryAlbums extends React.Component{
|
||||
columns={columns}
|
||||
className="album-list"
|
||||
link_prefix={global.baseURL+"album/"} />
|
||||
<LazyLoadListener loading={this.state.limit < total_albums} loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})} />
|
||||
<LazyLoadListener
|
||||
loadKey={total_albums}
|
||||
showLoader={this.state.limit < total_albums}
|
||||
loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
} else {
|
||||
@ -192,7 +196,11 @@ class LibraryAlbums extends React.Component{
|
||||
<AlbumGrid
|
||||
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
|
||||
albums={albums} />
|
||||
<LazyLoadListener loading={this.state.limit < total_albums} loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})} />
|
||||
<LazyLoadListener
|
||||
loadKey={total_albums}
|
||||
showLoader={this.state.limit < total_albums}
|
||||
loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
@ -159,7 +159,11 @@ class LibraryArtists extends React.Component{
|
||||
columns={columns}
|
||||
className="artist-list"
|
||||
link_prefix={global.baseURL+"artist/"} />
|
||||
<LazyLoadListener loading={this.state.limit < total_artists} loadMore={() => this.loadMore()} />
|
||||
<LazyLoadListener
|
||||
loadKey={total_artists}
|
||||
showLoader={this.state.limit < total_artists}
|
||||
loadMore={() => this.loadMore()}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
} else {
|
||||
@ -168,7 +172,11 @@ class LibraryArtists extends React.Component{
|
||||
<ArtistGrid
|
||||
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
|
||||
artists={artists} />
|
||||
<LazyLoadListener loading={this.state.limit < total_artists} loadMore={() => this.loadMore()} />
|
||||
<LazyLoadListener
|
||||
loadKey={total_artists}
|
||||
showLoader={this.state.limit < total_artists}
|
||||
loadMore={() => this.loadMore()}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
@ -155,7 +155,11 @@ class LibraryPlaylists extends React.Component{
|
||||
columns={columns}
|
||||
className="playlist-list"
|
||||
link_prefix={global.baseURL+"playlist/"} />
|
||||
<LazyLoadListener loading={this.state.limit < total_playlists} loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})} />
|
||||
<LazyLoadListener
|
||||
loadKey="playlists"
|
||||
loading={this.state.limit < total_playlists}
|
||||
loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
} else {
|
||||
@ -164,7 +168,11 @@ class LibraryPlaylists extends React.Component{
|
||||
<PlaylistGrid
|
||||
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
|
||||
playlists={playlists} />
|
||||
<LazyLoadListener loading={this.state.limit < total_playlists} loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})} />
|
||||
<LazyLoadListener
|
||||
loadKey="playlists"
|
||||
loading={this.state.limit < total_playlists}
|
||||
loadMore={() => this.setState({limit: this.state.limit + this.state.per_page})}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
@ -85,7 +85,11 @@ class LibraryTracks extends React.Component{
|
||||
</Header>
|
||||
<section className="content-wrapper">
|
||||
<TrackList tracks={tracks} />
|
||||
<LazyLoadListener loading={this.props.library_tracks_more} loadMore={() => this.loadMore()}/>
|
||||
<LazyLoadListener
|
||||
loadKey={this.props.library_tracks_more}
|
||||
loading={this.props.library_tracks_more}
|
||||
loadMore={() => this.loadMore()}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user