diff --git a/front/src/components/audio/Player.vue b/front/src/components/audio/Player.vue index 2b0032cf702666d23bc4b97fbc4999db5ee83017..31f6dc35ac3478a9b3c84b15a76ea9adcc044882 100644 --- a/front/src/components/audio/Player.vue +++ b/front/src/components/audio/Player.vue @@ -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' diff --git a/front/src/store/queue.js b/front/src/store/queue.js index 0908f180c9b148a63528336c6ac1b170046ea627..6a26fa1e9a0dc70609b0ea6fcba6e5b11745f277 100644 --- a/front/src/store/queue.js +++ b/front/src/store/queue.js @@ -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}) {