fix playing tracks from search page

This commit is contained in:
geoffrey45
2022-10-07 20:04:01 +03:00
committed by Mungai Njoroge
parent 6adf5df4c6
commit ffecfac8c7
5 changed files with 18 additions and 4 deletions
+3
View File
@@ -0,0 +1,3 @@
import SearchView from "./main.vue";
export default SearchView;
+12 -1
View File
@@ -1,7 +1,11 @@
<template>
<div class="search-tracks-view">
<div class="no-scroll">
<Layout :no_header="true" :tracks="search.tracks.value" />
<Layout
:no_header="true"
:tracks="search.tracks.value"
@playFromPage="playFromSearch"
/>
</div>
</div>
</template>
@@ -9,8 +13,15 @@
<script setup lang="ts">
import Layout from "@/layouts/HeaderAndVList.vue";
import useSearchStore from "@/stores/search";
import useQueueStore from "@/stores/queue";
const search = useSearchStore();
const queue = useQueueStore();
function playFromSearch(index: number) {
queue.playFromSearch(search.query, search.tracks.value);
queue.play(index);
}
</script>
<style lang="scss">