Merge branch 'KeithScheiwiller-master' into develop

This commit is contained in:
James Barnsley
2018-11-23 08:21:16 +13:00
3 changed files with 864 additions and 816 deletions

File diff suppressed because it is too large Load Diff

View File

@ -307,6 +307,16 @@ export default function reducer(spotify = {}, action){
}
return Object.assign({}, spotify, { library_playlists: items });
case 'SPOTIFY_LIBRARY_TRACK_CHECK':
var items = Object.assign([], spotify.library_tracks)
var index = items.indexOf(action.key)
if (index > -1 && !action.in_library) {
items.splice(index, 1)
} else if (index < 0 && action.in_library){
items.push(action.key)
}
return Object.assign({}, spotify, { library_tracks: items });
/**
* Searching

View File

@ -46,7 +46,9 @@ class LibraryTracks extends React.Component{
}
render(){
if (helpers.isLoading(this.props.load_queue,['spotify_me/tracks'])){
// Note trailing "?" makes sure our context menu in_library checks doesn't interfere
if (helpers.isLoading(this.props.load_queue,['spotify_me/tracks?'])){
return (
<div className="view library-tracks-view">
<Header icon="music" title="My tracks" />