See #262: added message feedback on play button
This commit is contained in:
parent
f8de5c2f00
commit
fd5c19163b
|
@ -124,19 +124,28 @@ export default {
|
||||||
add () {
|
add () {
|
||||||
let self = this
|
let self = this
|
||||||
this.getPlayableTracks().then((tracks) => {
|
this.getPlayableTracks().then((tracks) => {
|
||||||
self.$store.dispatch('queue/appendMany', {tracks: tracks})
|
self.$store.dispatch('queue/appendMany', {tracks: tracks}).then(() => self.addMessage(tracks))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addNext (next) {
|
addNext (next) {
|
||||||
let self = this
|
let self = this
|
||||||
let wasEmpty = this.$store.state.queue.tracks.length === 0
|
let wasEmpty = this.$store.state.queue.tracks.length === 0
|
||||||
this.getPlayableTracks().then((tracks) => {
|
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
|
let goNext = next && !wasEmpty
|
||||||
if (goNext) {
|
if (goNext) {
|
||||||
self.$store.dispatch('queue/next')
|
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()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue