Skip to content

Commit

Permalink
debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierPons committed Sep 27, 2017
1 parent ac5f2ec commit 2ae09dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Binary file modified src.zip
Binary file not shown.
12 changes: 6 additions & 6 deletions src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ class App extends React.Component {

}
addTrack(track) {
let tracks = this.state.playListTrack;
let tracks = this.state.playlistTrack;
if (!tracks.includes(track)){
tracks.push(track);
this.setState( {playListTracks: tracks} );
this.setState( {playlistTrack: tracks} );
}

}

removeTrack(track) {
let tracks = this.state.playListTracks;
let tracks = this.state.playlistTrack;

tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);
this.setState({playListTracks : tracks});
this.setState({playlistTrack : tracks});

}

Expand All @@ -52,7 +52,7 @@ class App extends React.Component {

savePlayList() {

const trackURIs = this.state.playListTracks.map(track => track.uri);
const trackURIs = this.state.playlistTrack.map(track => track.uri);

Spotify.savePlayList(this.state.playListName, trackURIs).then(()=>{
this.setState(
Expand All @@ -78,7 +78,7 @@ class App extends React.Component {
<SearchResults searchResults={this.state.searchResults}
onAdd={this.addTrack} />
<PlayList playListName={this.state.playListName}
playListTracks={this.state.playListTracks}
playlistTrack={this.state.playlistTrack}
onRemove={this.removeTrack}
onNameChange={this.updatePlayListName}
onSave={this.savePlayList}
Expand Down

0 comments on commit 2ae09dd

Please sign in to comment.