Skip to content

Commit

Permalink
fix: 🐛 Fixed a bug where selecting the first playlist was impossible
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLambrecht committed Sep 7, 2018
1 parent 1406a79 commit 15a253b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/components/PlaylistSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
primary
@click="fetchPlaylist"
>
Playlist laden
Load playlist
</b-button>
</div>
<div v-else class="form">
Expand All @@ -22,6 +22,9 @@
class="input select-box"
@change="fetchPlaylist"
>
<b-dropdown-item key="0">
---
</b-dropdown-item>
<b-dropdown-item
v-for="playlist in userPlaylists"
:key="playlist.id"
Expand All @@ -38,6 +41,8 @@
</template>

<script>
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'PlaylistSelector',
data() {
Expand All @@ -59,9 +64,12 @@ export default {
userPlaylists() {
return this.$store.state.user.playlists;
},
...mapGetters('editor', [
'playlistName',
]),
},
mounted() {
this.$store.dispatch('user/getPlaylists');
this.getPlaylists();
},
methods: {
async fetchPlaylist() {
Expand All @@ -75,6 +83,9 @@ export default {
switchMode() {
this.mode = this.mode === 'user' ? 'custom' : 'user';
},
...mapActions('user', [
'getPlaylists',
]),
},
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/SelectPlaylistModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<b-modal headline="Choose playlist">
<b-modal headline="Choose a playlist">
<playlist-selector @select="closeModal"/>
<div v-if="playlistExists" slot="footer">
<b-button @click="closeModal">Close</b-button>
Expand Down

0 comments on commit 15a253b

Please sign in to comment.