🐛 Fix the need to refresh to display the player when playing audio
This commit is contained in:
parent
146f5bf925
commit
14d6e2a315
@ -13,7 +13,6 @@ export default {
|
|||||||
add({ state, dispatch }, { audio, play }) {
|
add({ state, dispatch }, { audio, play }) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
var index = state.openedAudios.findIndex((s) => s.id === audio.id);
|
var index = state.openedAudios.findIndex((s) => s.id === audio.id);
|
||||||
console.log(index);
|
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
state.openedAudios.splice(index, 1);
|
state.openedAudios.splice(index, 1);
|
||||||
state.player.list.remove(index + state.customAudios.length || 0);
|
state.player.list.remove(index + state.customAudios.length || 0);
|
||||||
|
@ -18,7 +18,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState("acrou/aplayer", ["player", "audios"]),
|
...mapState("acrou/aplayer", ["player", "audios", "openedAudios"]),
|
||||||
container() {
|
container() {
|
||||||
return document.getElementById("aplayer");
|
return document.getElementById("aplayer");
|
||||||
},
|
},
|
||||||
@ -36,7 +36,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
return this.audios && this.audios.length > 0;
|
return (this.audios && this.audios.length > 0) || (this.openedAudios && this.openedAudios.length > 0);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
Loading…
Reference in New Issue
Block a user