remove div nesting on right sidebar

+ rewrite vTooltip to handle updates to tooltip text
This commit is contained in:
geoffrey45
2022-09-06 15:59:18 +03:00
parent 90514c8080
commit c9cd6a8067
8 changed files with 123 additions and 139 deletions
+13 -1
View File
@@ -6,7 +6,8 @@
:tracks="disc"
:on_album_page="true"
:disc="key"
:copyright="isLastDisc(key) ? () => copyright : null"
:copyright="isLastDisc(key) ? copyright : null"
@playFromPage="playFromAlbumPage"
/>
</div>
</div>
@@ -15,6 +16,8 @@
<script setup lang="ts">
import { Track } from "@/interfaces";
import SongList from "@/components/FolderView/SongList.vue";
import useQueueStore from "@/stores/queue";
import useAlbumStore from "@/stores/pages/album";
const props = defineProps<{
discs: {
@@ -23,11 +26,20 @@ const props = defineProps<{
copyright?: string;
}>();
const queue = useQueueStore();
const album = useAlbumStore();
// check if the disc is the last disc
const isLastDisc = (disc: string | number) => {
const discs = Object.keys(props.discs);
return discs[discs.length - 1] === disc;
};
function playFromAlbumPage(index: number) {
const { title, artist, hash } = album.info;
queue.playFromAlbum(title, artist, hash, album.tracks);
queue.play(index);
}
</script>
<style lang="scss">