fix: album/artist song lists are not sortable (#1619)

This commit is contained in:
Phan An 2022-12-07 01:44:42 +01:00 committed by GitHub
parent 8be339a23a
commit 9d275436e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -130,7 +130,7 @@ watch(songRows, () => setSelectedSongs(songRows.value.filter(row => row.selected
let lastScrollTop = 0
const onScroll = e => {
const onScroll = (e: Event) => {
const scroller = e.target as HTMLElement
if (scroller.scrollTop > 512 && lastScrollTop < 512) {

View file

@ -13,7 +13,10 @@ import SongList from '@/components/song/SongList.vue'
import SongListControls from '@/components/song/SongListControls.vue'
import ThumbnailStack from '@/components/ui/ThumbnailStack.vue'
export const useSongList = (songs: Ref<Song[]>, config: Partial<SongListConfig> = {}) => {
export const useSongList = (
songs: Ref<Song[]>,
config: Partial<SongListConfig> = { sortable: true, reorderable: true }
) => {
config = reactive(config)
const { isCurrentScreen, go, onRouteChanged } = useRouter()