From 5742d1a7626446d1cdd88cbd09b19bac83a41800 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Fri, 16 Aug 2024 23:50:36 +0200 Subject: [PATCH] fix: :zap: fix episode ending status with watch --- src/components/Feed/Episodes.vue | 15 +++++++++------ src/store/player.js | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/Feed/Episodes.vue b/src/components/Feed/Episodes.vue index 058e4bd..5376348 100644 --- a/src/components/Feed/Episodes.vue +++ b/src/components/Feed/Episodes.vue @@ -195,6 +195,15 @@ export default { return decodeUrl(this.$route.params.url) }, }, + watch: { + episode() { + if (this.episode) { + this.episodes = this.episodes.map((e) => + e.url === this.episode.url ? this.episode : e, + ) + } + }, + }, async mounted() { try { this.loading = true @@ -258,7 +267,6 @@ export default { generateUrl('/apps/gpoddersync/episode_action/create'), [episode.action], ) - this.updateList(episode) if (read && this.episode && episode.url === this.episode.url) { this.load(null) } @@ -269,11 +277,6 @@ export default { this.loadingAction = false } }, - updateList(episode) { - this.episodes = this.episodes.map((e) => - e.url === episode.url ? episode : e, - ) - }, }, } diff --git a/src/store/player.js b/src/store/player.js index c769625..adb4b41 100644 --- a/src/store/player.js +++ b/src/store/player.js @@ -66,6 +66,7 @@ export const usePlayer = defineStore('player', { pause() { audio.pause() this.paused = true + this.time() }, play() { audio.play()