diff --git a/front/src/App.vue b/front/src/App.vue index 347f19e30..d15eebdba 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -29,6 +29,8 @@ v-if="$store.state.instance.settings.raven.front_enabled.value" :dsn="$store.state.instance.settings.raven.front_dsn.value"> + + @@ -39,11 +41,14 @@ import logger from '@/logging' import Sidebar from '@/components/Sidebar' import Raven from '@/components/Raven' +import PlaylistModal from '@/components/playlists/PlaylistModal' + export default { name: 'app', components: { Sidebar, - Raven + Raven, + PlaylistModal }, created () { this.$store.dispatch('instance/fetchSettings') diff --git a/front/src/components/playlists/PlaylistModal.vue b/front/src/components/playlists/PlaylistModal.vue index 7bf027db7..b470eb5ce 100644 --- a/front/src/components/playlists/PlaylistModal.vue +++ b/front/src/components/playlists/PlaylistModal.vue @@ -1,36 +1,53 @@ @@ -48,10 +65,6 @@ export default { Modal, PlaylistForm }, - props: { - track: {type: Object}, - show: {type: Boolean} - }, data () { return { errors: [] @@ -59,7 +72,7 @@ export default { }, methods: { update (v) { - this.$emit('update:show', v) + this.$store.commit('playlists/showModal', v) }, addToPlaylist (playlistId) { let self = this @@ -69,7 +82,7 @@ export default { } return axios.post('playlist-tracks/', payload).then(response => { logger.default.info('Successfully added track to playlist') - self.$emit('update:show', false) + self.update(false) self.$store.dispatch('playlists/fetchOwn') }, error => { logger.default.error('Error while adding track to playlist') @@ -79,7 +92,8 @@ export default { }, computed: { ...mapState({ - playlists: state => state.playlists.playlists + playlists: state => state.playlists.playlists, + track: state => state.playlists.modalTrack }), sortedPlaylists () { let p = _.sortBy(this.playlists, [(e) => { return e.modification_date }]) diff --git a/front/src/components/playlists/TrackPlaylistIcon.vue b/front/src/components/playlists/TrackPlaylistIcon.vue index 2684f7cb6..843d15392 100644 --- a/front/src/components/playlists/TrackPlaylistIcon.vue +++ b/front/src/components/playlists/TrackPlaylistIcon.vue @@ -1,28 +1,22 @@