diff --git a/src/components/Player.vue b/src/components/Player.vue index 0defff9..8b70d1f 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -203,8 +203,13 @@ export default { this.audio.play(); } }, - reset(container) { - this.$store.dispatch("user/resetProgress", container); + reset(item) { + let parentId = item.parent._id; + if (item.parent.parent && item.parent.parent.tracks) { + parentId = item.parent.parent._id; + } + console.log(parentId); + this.$store.dispatch("user/resetProgress", parentId); window.clearInterval(this.intervalProgress); window.clearInterval(this.intervalState); diff --git a/src/store/modules/user/actions.js b/src/store/modules/user/actions.js index 53348f3..4a2acd5 100644 --- a/src/store/modules/user/actions.js +++ b/src/store/modules/user/actions.js @@ -98,12 +98,12 @@ export default { parent.progress = res.data; }); }, - resetProgress(context, item) { + resetProgress(context, parentId) { if (context.state._id == -1) { return; } axios - .delete(context.rootGetters.server + "/api/user/progress/" + item.album_id, context.rootGetters.headers); + .delete(context.rootGetters.server + "/api/user/progress/" + parentId, context.rootGetters.headers); }, savePlayerSettings(context) { let body = {