Skip to content

Commit e330a12

Browse files
committed
For You !
1 parent ffdf0e3 commit e330a12

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

config.dev.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const config = {
22
initialRoute: {
33
id: 'welcome',
4-
title: 'We know you better than you do',
4+
// id: 'loginSpotify',
5+
title: 'For you!',
56
},
67
spotify: {
78
clientId: '5f8143a295f04c2c99eee060120bb98d',

src/assets/img/logo.jpg

-13.1 KB
Loading

src/assets/img/logo.png

1.49 KB
Loading

src/assets/img/logo_only.jpg

78.2 KB
Loading

src/stores/SpotifyStore.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class SpotifyStore {
2020
this.playlist = null
2121

2222
// TODO :: Remove
23-
this.artists = MockedArtists
24-
this.relatedArtists = MockedRelatedArtists
25-
this.topTracks = MockedTopTracks
26-
this.playlist = MockedPlaylist
23+
// this.artists = MockedArtists
24+
// this.relatedArtists = MockedRelatedArtists
25+
// this.topTracks = MockedTopTracks
26+
// this.playlist = MockedPlaylist
2727

2828
this.errorMessage = null
2929
this.access_token
@@ -163,11 +163,13 @@ class SpotifyStore {
163163
const name = options[0]
164164
const tracks = options[1]
165165

166-
// SpotifyConnect.createPlaylist(name, this.me.id)
167-
// .catch((error) => this.errorMessage = error)
168-
// .then((playlist) => {
169-
// this.playlist = playlist
170-
// })
166+
SpotifyConnect.createPlaylist(name, this.me.id)
167+
.catch((error) => this.createPlaylistFailed(error))
168+
.then((playlist) => {
169+
this.playlist = playlist
170+
this._addTracksToPlaylist(tracks)
171+
})
172+
}
171173

172174
const tracksURIs = tracks.map((track) => track.uri)
173175

@@ -180,7 +182,7 @@ class SpotifyStore {
180182
}
181183

182184
createPlaylistSuccess(data) {
183-
const playlist = this.state.playlist
185+
const playlist = this.playlist
184186
playlist.tracks.items = data
185187
this.setState({ errorMessage: null, playlist: playlist })
186188
}

src/views/CreatePlaylist/CreatePlaylist.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ export default class CreatePlaylist extends ViewBase {
1616
this.state = {
1717
topTracks: [],
1818
errorMessage: null,
19-
playlist: null,
2019
}
2120
}
2221

2322
_createPlaylist() {
2423
// Get current user owner
25-
SpotifyActions.createPlaylist("My awesome playlist", this.state.topTracks)
24+
this.props.navigator.push({
25+
id: 'enjoyPlaylist',
26+
title: 'Enjoy your awesome playlist',
27+
})
2628
}
2729

2830
componentDidMount() {
2931
SpotifyStore.listen(this.onChange.bind(this))
3032
SpotifyActions.fetchTopTracks()
33+
// this.onChange()
3134
}
3235

3336
componentWillUnmount() {
@@ -40,7 +43,6 @@ export default class CreatePlaylist extends ViewBase {
4043
this.setState({
4144
errorMessage: state.errorMessage,
4245
topTracks: state.topTracks,
43-
playlist: state.playlist,
4446
})
4547
}
4648

0 commit comments

Comments
 (0)