Skip to content
Snippets Groups Projects
Commit 69a3f347 authored by Bat's avatar Bat
Browse files

Disable previous button if queue is empty

parent eea1abad
No related branches found
No related tags found
No related merge requests found
......@@ -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}) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment