🐛 Fix the need to refresh to display the player when playing audio

This commit is contained in:
Aicirou 2020-08-21 22:23:21 +08:00
parent 146f5bf925
commit 14d6e2a315
2 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,6 @@ export default {
add({ state, dispatch }, { audio, play }) {
return new Promise((resolve) => {
var index = state.openedAudios.findIndex((s) => s.id === audio.id);
console.log(index);
if (index >= 0) {
state.openedAudios.splice(index, 1);
state.player.list.remove(index + state.customAudios.length || 0);

View File

@ -18,7 +18,7 @@ export default {
});
},
computed: {
...mapState("acrou/aplayer", ["player", "audios"]),
...mapState("acrou/aplayer", ["player", "audios", "openedAudios"]),
container() {
return document.getElementById("aplayer");
},
@ -36,7 +36,7 @@ export default {
};
},
show() {
return this.audios && this.audios.length > 0;
return (this.audios && this.audios.length > 0) || (this.openedAudios && this.openedAudios.length > 0);
},
},
methods: {