mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
add playlist store method to reset banner position
This commit is contained in:
committed by
Mungai Njoroge
parent
ceedc22843
commit
d60acaa9ef
@@ -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<FuseResult[]> {
|
||||
|
||||
Reference in New Issue
Block a user