From d60acaa9ef533a981dbf678fe385ae47d8b324b7 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Fri, 13 Jan 2023 16:11:11 +0300 Subject: [PATCH] add playlist store method to reset banner position --- src/stores/pages/playlist.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stores/pages/playlist.ts b/src/stores/pages/playlist.ts index 511e6eb8..e3544b64 100644 --- a/src/stores/pages/playlist.ts +++ b/src/stores/pages/playlist.ts @@ -21,6 +21,7 @@ export default defineStore("playlist-tracks", { * @param id The id of the playlist to fetch */ async fetchAll(id: string) { + this.resetBannerPos(); const playlist = await getPlaylist(id); this.info = playlist?.info || ({} as Playlist); @@ -43,6 +44,7 @@ export default defineStore("playlist-tracks", { this.info = info; this.info = { ...this.info, duration, count }; + this.bannerPos = this.info.banner_pos; }, plusBannerPos() { this.bannerPos !== 100 ? (this.bannerPos += 10) : null; @@ -56,6 +58,9 @@ export default defineStore("playlist-tracks", { resetQuery() { this.query = ""; }, + resetBannerPos() { + this.bannerPos = 50; + }, }, getters: { filteredTracks(): ComputedRef {