add 'add to queue'
This commit is contained in:
parent
b949db6efd
commit
d89bbfe5f7
@ -6,6 +6,9 @@
|
||||
<b-dropdown-item-button @click="playNext()">
|
||||
Play next
|
||||
</b-dropdown-item-button>
|
||||
<b-dropdown-item-button @click="addToQueue()">
|
||||
Add to queue
|
||||
</b-dropdown-item-button>
|
||||
<b-dropdown-item-button @click="toggleStarred()">
|
||||
{{ starred ? 'Unstar' : 'Star' }}
|
||||
</b-dropdown-item-button>
|
||||
@ -36,6 +39,9 @@
|
||||
playNext() {
|
||||
return this.$store.dispatch("player/playNext", this.track);
|
||||
},
|
||||
addToQueue() {
|
||||
return this.$store.dispatch("player/addToQueue", this.track);
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -66,6 +66,9 @@ export const playerModule: Module<State, any> = {
|
||||
});
|
||||
}
|
||||
},
|
||||
addToQueue(state, track) {
|
||||
state.queue.push(track);
|
||||
},
|
||||
removeFromQueue(state, index) {
|
||||
state.queue.splice(index, 1);
|
||||
if (index < state.queueIndex) {
|
||||
@ -120,6 +123,9 @@ export const playerModule: Module<State, any> = {
|
||||
playNext({ commit }, track) {
|
||||
commit("setNextInQueue", track);
|
||||
},
|
||||
addToQueue({ commit }, track) {
|
||||
commit("addToQueue", track);
|
||||
},
|
||||
},
|
||||
|
||||
getters: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user