Added spotify player
This commit is contained in:
@@ -9,7 +9,8 @@ export default new Vuex.Store({
|
||||
name: null
|
||||
},
|
||||
appReady: false,
|
||||
playerActive: false
|
||||
playerActive: false,
|
||||
playerUrl: ""
|
||||
},
|
||||
mutations: {
|
||||
storeUserData(state, username) {
|
||||
@@ -17,8 +18,15 @@ export default new Vuex.Store({
|
||||
},
|
||||
setAppReady(state) {
|
||||
state.appReady = true;
|
||||
},
|
||||
openPlayer(state, spotify_id) {
|
||||
const id_parts = spotify_id.split(":");
|
||||
state.playerUrl = `https://open.spotify.com/embed/${id_parts[1]}/${id_parts[2]}`;
|
||||
state.playerActive = true;
|
||||
},
|
||||
closePlayer(state) {
|
||||
state.playerActive = false;
|
||||
}
|
||||
|
||||
},
|
||||
actions: {
|
||||
storeUserData({commit}, username) {
|
||||
@@ -26,6 +34,12 @@ export default new Vuex.Store({
|
||||
},
|
||||
setAppReady({commit}) {
|
||||
commit('setAppReady');
|
||||
},
|
||||
openPlayer({commit}, spotify_id) {
|
||||
commit('openPlayer', spotify_id);
|
||||
},
|
||||
closePlayer({commit}) {
|
||||
commit('closePlayer');
|
||||
}
|
||||
},
|
||||
modules: {},
|
||||
|
||||
Reference in New Issue
Block a user