fix: errors tab displaying

This commit is contained in:
Roberto Tonino
2020-09-19 15:11:06 +02:00
parent 5fc41db230
commit 6e195827aa
8 changed files with 73 additions and 37 deletions

View File

@@ -0,0 +1,45 @@
const state = {
artist: '',
bitrate: '',
cover: '',
downloaded: 0,
errors: [],
failed: 0,
id: '',
progress: 0,
silent: true,
size: 0,
title: '',
type: '',
uuid: ''
}
const actions = {
setErrors({ commit }, payload) {
commit('SET_ERRORS', payload)
}
}
const getters = {
getErrors: state => state
}
const mutations = {
SET_ERRORS(state, payload) {
// The payload has useless data for the GUI, so only the needed data is saved in the store
for (const errorName in state) {
if (state.hasOwnProperty(errorName)) {
const error = payload[errorName]
state[errorName] = error
}
}
}
}
export default {
state,
getters,
actions,
mutations
}

View File

@@ -4,7 +4,8 @@ const state = {
albums: [],
artists: [],
playlists: [],
tracks: []
tracks: [],
test: ''
}
const actions = {
@@ -21,7 +22,7 @@ const actions = {
commit('SET_FAVORITES_ARTISTS', { index, data: artist })
})
dispatch('setFavoritesTracks', payload.tracks)
// dispatch('setFavoritesTracks', payload.tracks)
},
setFavoritesTracks({ commit }, payload) {
payload.forEach((track, index) => {