From 39d2c3028d0b3c597504a3d6fc2f8d6cd0a89a37 Mon Sep 17 00:00:00 2001 From: Eliot Berriot <contact@eliotberriot.com> Date: Sat, 21 Jul 2018 14:47:12 +0200 Subject: [PATCH] Fixed #304: persistent message in playlist modal --- changes/changelog.d/304.bugfix | 1 + front/src/components/playlists/PlaylistModal.vue | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changes/changelog.d/304.bugfix diff --git a/changes/changelog.d/304.bugfix b/changes/changelog.d/304.bugfix new file mode 100644 index 000000000..477297a18 --- /dev/null +++ b/changes/changelog.d/304.bugfix @@ -0,0 +1 @@ +Fixed persistent message in playlist modal (#304) diff --git a/front/src/components/playlists/PlaylistModal.vue b/front/src/components/playlists/PlaylistModal.vue index 668dbf75e..a5a7e9ea0 100644 --- a/front/src/components/playlists/PlaylistModal.vue +++ b/front/src/components/playlists/PlaylistModal.vue @@ -7,15 +7,15 @@ <div class="description"> <template v-if="track"> <h4 class="ui header"><translate>Current track</translate></h4> - <div + <translate v-translate="{artist: track.artist.name, title: track.title}" - :template-params="{artist: track.artist.name, title: track.title}"> + :translate-params="{artist: track.artist.name, title: track.title}"> "%{ title }", by %{ artist } - </div> + </translate> <div class="ui divider"></div> </template> - <playlist-form></playlist-form> + <playlist-form :key="formKey"></playlist-form> <div class="ui divider"></div> <div v-if="errors.length > 0" class="ui negative message"> <div class="header"><translate>We cannot add the track to a playlist</translate></div> @@ -82,6 +82,7 @@ export default { }, data () { return { + formKey: String(new Date()), errors: [] } }, @@ -124,6 +125,9 @@ export default { watch: { '$store.state.route.path' () { this.$store.commit('playlists/showModal', false) + }, + '$store.state.playlists.showModal' () { + this.formKey = String(new Date()) } } } -- GitLab