|
@@ -10,6 +10,7 @@ export default {
|
|
actions: {
|
|
actions: {
|
|
showTab: ({ commit }, tab) => commit("showTab", tab),
|
|
showTab: ({ commit }, tab) => commit("showTab", tab),
|
|
setPlaylist: ({ commit }, playlist) => commit("setPlaylist", playlist),
|
|
setPlaylist: ({ commit }, playlist) => commit("setPlaylist", playlist),
|
|
|
|
+ clearPlaylist: ({ commit }) => commit("clearPlaylist"),
|
|
addSong: ({ commit }, song) => commit("addSong", song),
|
|
addSong: ({ commit }, song) => commit("addSong", song),
|
|
removeSong: ({ commit }, youtubeId) => commit("removeSong", youtubeId),
|
|
removeSong: ({ commit }, youtubeId) => commit("removeSong", youtubeId),
|
|
updatePlaylistSongs: ({ commit }, playlistSongs) =>
|
|
updatePlaylistSongs: ({ commit }, playlistSongs) =>
|
|
@@ -24,6 +25,9 @@ export default {
|
|
state.playlist = { ...playlist };
|
|
state.playlist = { ...playlist };
|
|
state.playlist.songs.sort((a, b) => a.position - b.position);
|
|
state.playlist.songs.sort((a, b) => a.position - b.position);
|
|
},
|
|
},
|
|
|
|
+ clearPlaylist(state) {
|
|
|
|
+ state.playlist = { songs: [] };
|
|
|
|
+ },
|
|
addSong(state, song) {
|
|
addSong(state, song) {
|
|
state.playlist.songs.push(song);
|
|
state.playlist.songs.push(song);
|
|
},
|
|
},
|