mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
fix: sortable/reorderable song list messed up
This commit is contained in:
parent
69368bfbd8
commit
023b504ef6
4 changed files with 5 additions and 10 deletions
|
@ -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')
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ const {
|
|||
playSelected,
|
||||
applyFilter,
|
||||
onScrollBreakpoint
|
||||
} = useSongList(recentlyPlayedSongs)
|
||||
} = useSongList(recentlyPlayedSongs, { sortable: false })
|
||||
|
||||
const { SongListControls, config } = useSongListControls('RecentlyPlayed')
|
||||
|
||||
|
|
|
@ -21,16 +21,11 @@ import ThumbnailStack from '@/components/ui/ThumbnailStack.vue'
|
|||
|
||||
export const useSongList = (
|
||||
songs: Ref<Song[]>,
|
||||
config: Partial<SongListConfig> = { sortable: true, reorderable: true, collaborative: false }
|
||||
config: Partial<SongListConfig> = { 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<InstanceType<typeof SongList>>()
|
||||
|
||||
|
|
Loading…
Reference in a new issue