Defaufault sorting; playback control button feedback, fixes #299
This commit is contained in:
@ -138,7 +138,9 @@ class LibraryAlbums extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse)
|
||||
if (this.props.sort){
|
||||
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse);
|
||||
}
|
||||
|
||||
if (this.state.filter && this.state.filter !== ''){
|
||||
albums = helpers.applyFilter('name', this.state.filter, albums)
|
||||
@ -225,6 +227,10 @@ class LibraryAlbums extends React.Component{
|
||||
]
|
||||
|
||||
var sort_options = [
|
||||
{
|
||||
value: null,
|
||||
label: 'Default'
|
||||
},
|
||||
{
|
||||
value: 'name',
|
||||
label: 'Name'
|
||||
@ -255,7 +261,7 @@ class LibraryAlbums extends React.Component{
|
||||
name="Sort"
|
||||
value={this.props.sort}
|
||||
options={sort_options}
|
||||
selected_icon={this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}
|
||||
selected_icon={this.props.sort ? (this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down') : null}
|
||||
handleChange={val => {this.setSort(val); this.props.uiActions.hideContextMenu() }}
|
||||
/>
|
||||
<DropdownField
|
||||
@ -306,8 +312,8 @@ const mapStateToProps = (state, ownProps) => {
|
||||
spotify_library_albums_status: (state.ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR !== undefined ? state.ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR.status : null),
|
||||
view: state.ui.library_albums_view,
|
||||
source: (state.ui.library_albums_source ? state.ui.library_albums_source : 'all'),
|
||||
sort: (state.ui.library_albums_sort ? state.ui.library_albums_sort : 'name'),
|
||||
sort_reverse: (state.ui.library_albums_sort_reverse ? true : false)
|
||||
sort: (state.ui.library_albums_sort ? state.ui.library_albums_sort : null),
|
||||
sort_reverse: (state.ui.library_albums_sort_reverse ? state.ui.library_albums_sort_reverse : false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +122,9 @@ class LibraryArtists extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
artists = helpers.sortItems(artists, this.props.sort, this.props.sort_reverse)
|
||||
if (this.props.sort){
|
||||
artists = helpers.sortItems(artists, this.props.sort, this.props.sort_reverse);
|
||||
}
|
||||
|
||||
if (this.state.filter !== ''){
|
||||
artists = helpers.applyFilter('name', this.state.filter, artists)
|
||||
@ -201,6 +203,10 @@ class LibraryArtists extends React.Component{
|
||||
];
|
||||
|
||||
var sort_options = [
|
||||
{
|
||||
label: 'Default',
|
||||
value: null
|
||||
},
|
||||
{
|
||||
label: 'Name',
|
||||
value: 'name'
|
||||
@ -223,7 +229,7 @@ class LibraryArtists extends React.Component{
|
||||
name="Sort"
|
||||
value={this.props.sort}
|
||||
options={sort_options}
|
||||
selected_icon={this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}
|
||||
selected_icon={this.props.sort ? (this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down') : null}
|
||||
handleChange={value => {this.setSort(value); this.props.uiActions.hideContextMenu() }}
|
||||
/>
|
||||
<DropdownField
|
||||
@ -272,8 +278,8 @@ const mapStateToProps = (state, ownProps) => {
|
||||
spotify_library_artists_status: (state.ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR !== undefined ? state.ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR.status : null),
|
||||
artists: state.core.artists,
|
||||
source: (state.ui.library_artists_source ? state.ui.library_artists_source : 'all'),
|
||||
sort: (state.ui.library_artists_sort ? state.ui.library_artists_sort : 'name'),
|
||||
sort_reverse: (state.ui.library_artists_sort_reverse ? true : false),
|
||||
sort: (state.ui.library_artists_sort ? state.ui.library_artists_sort : null),
|
||||
sort_reverse: (state.ui.library_artists_sort_reverse ? state.ui.library_artists_sort_reverse : false),
|
||||
view: state.ui.library_artists_view
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,9 @@ class LibraryPlaylists extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
playlists = helpers.sortItems(playlists, this.props.sort, this.props.sort_reverse);
|
||||
if (this.props.sort){
|
||||
playlists = helpers.sortItems(playlists, this.props.sort, this.props.sort_reverse);
|
||||
}
|
||||
playlists = helpers.removeDuplicates(playlists);
|
||||
|
||||
if (this.state.filter !== ''){
|
||||
@ -197,6 +199,10 @@ class LibraryPlaylists extends React.Component{
|
||||
];
|
||||
|
||||
var sort_options = [
|
||||
{
|
||||
value: null,
|
||||
label: 'Default'
|
||||
},
|
||||
{
|
||||
value: 'name',
|
||||
label: 'Name'
|
||||
@ -229,7 +235,7 @@ class LibraryPlaylists extends React.Component{
|
||||
name="Sort"
|
||||
value={this.props.sort}
|
||||
options={sort_options}
|
||||
selected_icon={this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}
|
||||
selected_icon={this.props.sort ? (this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down') : null}
|
||||
handleChange={value => {this.setSort(value); this.props.uiActions.hideContextMenu() }}
|
||||
/>
|
||||
<DropdownField
|
||||
@ -284,8 +290,8 @@ const mapStateToProps = (state, ownProps) => {
|
||||
me_id: (state.spotify.me ? state.spotify.me.id : false),
|
||||
view: state.ui.library_playlists_view,
|
||||
source: (state.ui.library_playlists_source ? state.ui.library_playlists_source : 'all'),
|
||||
sort: (state.ui.library_playlists_sort ? state.ui.library_playlists_sort : 'name'),
|
||||
sort_reverse: (state.ui.library_playlists_sort_reverse ? true : false),
|
||||
sort: (state.ui.library_playlists_sort ? state.ui.library_playlists_sort : null),
|
||||
sort_reverse: (state.ui.library_playlists_sort_reverse ? state.ui.library_playlists_sort_reverse : false),
|
||||
playlists: state.core.playlists
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user