Disable previous button if queue is empty
This commit is contained in:
parent
eea1abad5c
commit
69a3f34784
|
@ -58,8 +58,9 @@
|
||||||
<div class="two wide column controls ui grid">
|
<div class="two wide column controls ui grid">
|
||||||
<div
|
<div
|
||||||
title="Previous track"
|
title="Previous track"
|
||||||
class="two wide column control">
|
class="two wide column control"
|
||||||
<i @click="previous" class="ui step backward big icon"></i>
|
:disabled="emptyQueue">
|
||||||
|
<i @click="previous" :class="['ui', 'backward', {'disabled': emptyQueue}, 'big', 'icon']"></i>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="!playing"
|
v-if="!playing"
|
||||||
|
@ -204,6 +205,7 @@ export default {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
currentTrack: 'queue/currentTrack',
|
currentTrack: 'queue/currentTrack',
|
||||||
hasNext: 'queue/hasNext',
|
hasNext: 'queue/hasNext',
|
||||||
|
emptyQueue: 'queue/isEmpty',
|
||||||
durationFormatted: 'player/durationFormatted',
|
durationFormatted: 'player/durationFormatted',
|
||||||
currentTimeFormatted: 'player/currentTimeFormatted',
|
currentTimeFormatted: 'player/currentTimeFormatted',
|
||||||
progress: 'player/progress'
|
progress: 'player/progress'
|
||||||
|
|
|
@ -48,7 +48,8 @@ export default {
|
||||||
},
|
},
|
||||||
hasNext: state => {
|
hasNext: state => {
|
||||||
return state.currentIndex < state.tracks.length - 1
|
return state.currentIndex < state.tracks.length - 1
|
||||||
}
|
},
|
||||||
|
isEmpty: state => state.tracks.length === 0
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
append ({commit, state, dispatch}, {track, index, skipPlay}) {
|
append ({commit, state, dispatch}, {track, index, skipPlay}) {
|
||||||
|
|
Loading…
Reference in New Issue