From 023b504ef62fa6d89b50fee7efe8268a165bbdd8 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 23 Jan 2024 00:11:13 +0100 Subject: [PATCH] fix: sortable/reorderable song list messed up --- .../assets/js/components/screens/AllSongsScreen.vue | 2 +- resources/assets/js/components/screens/QueueScreen.vue | 2 +- .../js/components/screens/RecentlyPlayedScreen.vue | 2 +- resources/assets/js/composables/useSongList.ts | 9 ++------- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/resources/assets/js/components/screens/AllSongsScreen.vue b/resources/assets/js/components/screens/AllSongsScreen.vue index dc614918..dc9d0e26 100644 --- a/resources/assets/js/components/screens/AllSongsScreen.vue +++ b/resources/assets/js/components/screens/AllSongsScreen.vue @@ -87,7 +87,7 @@ const { onPressEnter, playSelected, onScrollBreakpoint -} = useSongList(toRef(songStore.state, 'songs')) +} = useSongList(toRef(songStore.state, 'songs'), { sortable: true }) const { SongListControls, config } = useSongListControls('Songs') diff --git a/resources/assets/js/components/screens/QueueScreen.vue b/resources/assets/js/components/screens/QueueScreen.vue index 8b45da46..7f7e7073 100644 --- a/resources/assets/js/components/screens/QueueScreen.vue +++ b/resources/assets/js/components/screens/QueueScreen.vue @@ -79,7 +79,7 @@ const { playSelected, applyFilter, onScrollBreakpoint -} = useSongList(toRef(queueStore.state, 'songs')) +} = useSongList(toRef(queueStore.state, 'songs'), { reorderable: true, sortable: false }) const { SongListControls, config } = useSongListControls('Queue') diff --git a/resources/assets/js/components/screens/RecentlyPlayedScreen.vue b/resources/assets/js/components/screens/RecentlyPlayedScreen.vue index 30376c31..95abac4f 100644 --- a/resources/assets/js/components/screens/RecentlyPlayedScreen.vue +++ b/resources/assets/js/components/screens/RecentlyPlayedScreen.vue @@ -67,7 +67,7 @@ const { playSelected, applyFilter, onScrollBreakpoint -} = useSongList(recentlyPlayedSongs) +} = useSongList(recentlyPlayedSongs, { sortable: false }) const { SongListControls, config } = useSongListControls('RecentlyPlayed') diff --git a/resources/assets/js/composables/useSongList.ts b/resources/assets/js/composables/useSongList.ts index 4f1dca66..3da399a8 100644 --- a/resources/assets/js/composables/useSongList.ts +++ b/resources/assets/js/composables/useSongList.ts @@ -21,16 +21,11 @@ import ThumbnailStack from '@/components/ui/ThumbnailStack.vue' export const useSongList = ( songs: Ref, - config: Partial = { sortable: true, reorderable: true, collaborative: false } + config: Partial = { sortable: true, reorderable: false, collaborative: false } ) => { const filterKeywords = ref('') config = reactive(config) - const { isCurrentScreen, go, onRouteChanged } = useRouter() - - onRouteChanged(route => { - config.reorderable = route.screen === 'Queue' - config.sortable = !['Queue', 'RecentlyPlayed', 'Search.Songs'].includes(route.screen) - }) + const { isCurrentScreen, go } = useRouter() const songList = ref>()