Verified Commit fd5c1916 authored by Agate's avatar Agate 💬

See #262: added message feedback on play button

parent f8de5c2f
......@@ -124,19 +124,28 @@ export default {
add () {
let self = this
this.getPlayableTracks().then((tracks) => {
self.$store.dispatch('queue/appendMany', {tracks: tracks})
self.$store.dispatch('queue/appendMany', {tracks: tracks}).then(() => self.addMessage(tracks))
})
},
addNext (next) {
let self = this
let wasEmpty = this.$store.state.queue.tracks.length === 0
this.getPlayableTracks().then((tracks) => {
self.$store.dispatch('queue/appendMany', {tracks: tracks, index: self.$store.state.queue.currentIndex + 1})
self.$store.dispatch('queue/appendMany', {tracks: tracks, index: self.$store.state.queue.currentIndex + 1}).then(() => self.addMessage(tracks))
let goNext = next && !wasEmpty
if (goNext) {
self.$store.dispatch('queue/next')
}
})
},
addMessage (tracks) {
if (tracks.length < 1) {
return
}
this.$store.commit('ui/addMessage', {
content: this.$t('{% tracks %} tracks were added to your queue.', {tracks: tracks.length}),
date: new Date()
})
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment