build: v1.5.2; fix: spotify favorites playlist not showing in Favorites page until the refresh button is clicked (closes #21); refactor: favorites logic

This commit is contained in:
Roberto Tonino
2020-11-28 22:11:11 +01:00
parent 835b0e9f8d
commit d752efa30f
7 changed files with 172 additions and 169 deletions

View File

@@ -6,10 +6,17 @@ const getDefaultState = () => ({
name: '',
picture: ''
},
spotifyUser: {
id: localStorage.getItem('spotifyUser'),
name: null,
picture: null
},
clientMode: false
})
const state = getDefaultState()
const state = () => {
return getDefaultState()
}
const actions = {
login({ commit, dispatch }, payload) {
@@ -51,8 +58,11 @@ const actions = {
const getters = {
getARL: state => state.arl,
getUser: state => state.user,
getSpotifyUser: state => state.spotifyUser,
getClientMode: state => state.clientMode,
isLoggedIn: state => !!state.arl
isLoggedIn: state => !!state.arl,
isLoggedWithSpotify: state => !!state.spotifyUser.id
}
const mutations = {