fix removing tracks from queue

This commit is contained in:
geoffrey45
2022-10-08 19:32:29 +03:00
committed by Mungai Njoroge
parent bb66ba70b3
commit a496d68439
9 changed files with 71 additions and 47 deletions
+5 -5
View File
@@ -34,13 +34,13 @@ import { computed } from "@vue/reactivity";
import { onBeforeRouteLeave, onBeforeRouteUpdate } from "vue-router";
import { Track } from "@/interfaces";
import useQueueStore from "@/stores/queue";
import { isMedium, isSmall } from "@/stores/content-width";
import useLoaderStore from "@/stores/loader";
import useFolderStore from "@/stores/pages/folder";
import { isSmall, isMedium } from "@/stores/content-width";
import useQueueStore from "@/stores/queue";
import SongItem from "@/components/shared/SongItem.vue";
import FolderList from "@/components/FolderView/FolderList.vue";
import SongItem from "@/components/shared/SongItem.vue";
const loader = useLoaderStore();
const folder = useFolderStore();
@@ -62,9 +62,9 @@ class songItem {
this.props = {
track,
index: track.index + 1,
isCurrent: queue.currenttrack?.hash === track.hash,
isCurrent: queue.currentid === track.trackid,
isCurrentPlaying:
queue.currenttrack?.hash === track.hash && queue.playing,
queue.currentid === track.trackid && queue.playing,
};
}
}
+2 -2
View File
@@ -36,7 +36,7 @@ const queue = useQueueStore();
const playlist = usePlaylistStore();
interface ScrollerItem {
id: string;
id: string | number;
component: typeof Header | typeof SongItem;
props: Record<string, unknown>;
size: number;
@@ -56,7 +56,7 @@ const scrollerItems = computed(() => {
header,
...playlist.tracks.map((track) => {
return {
id: track.trackid,
id: Math.random(),
component: SongItem,
props: {
track: track,
+2 -2
View File
@@ -16,9 +16,9 @@
<SongItem
:track="item.track"
:index="index + 1"
:isCurrent="queue.currenttrack?.hash === item.track.hash"
:isCurrent="queue.currentid === item.trackid"
:isCurrentPlaying="
queue.currenttrack?.hash === item.track.hash && queue.playing
queue.currentid === item.trackid && queue.playing
"
@playThis="playFromQueue(index)"
/>