add all favorite tracks page

This commit is contained in:
geoffrey45
2023-01-01 19:36:07 +03:00
committed by Mungai Njoroge
parent 108182ab01
commit 22d5f6e896
5 changed files with 37 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
<template>
<SongList :tracks="tracks" :handlePlay="handlePlay" />
</template>
<script setup lang="ts">
import { Ref, ref } from "vue";
import { Track } from "@/interfaces";
import useQueueStore from "@/stores/queue";
import { getFavTracks } from "@/composables/fetch/favorite";
import SongList from "@/components/shared/SongList.vue";
const tracks: Ref<Track[]> = ref([]);
const queue = useQueueStore();
getFavTracks(0).then((data) => (tracks.value = data));
function handlePlay(index: number) {
queue.playFromFav(tracks.value);
queue.play(index);
}
</script>
+1 -1
View File
@@ -11,7 +11,7 @@
<div class="fav-tracks" v-if="favTracks.length">
<TopTracks
:tracks="favTracks"
:route="'/home'"
:route="'/favorites/tracks'"
:title="'Tracks ❤️'"
:playHandler="handlePlay"
/>