Commit 69a3f347 authored by Ana Gelez's avatar Ana Gelez

Disable previous button if queue is empty

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