Limit number of playlists displayed in the sidebar, to avoid UI freezes

This commit is contained in:
Deluan 2021-10-02 21:39:33 -04:00
parent 2b105ca77b
commit e673360087
2 changed files with 4 additions and 2 deletions

View File

@ -18,3 +18,5 @@ DraggableTypes.ALL.push(
DraggableTypes.DISC,
DraggableTypes.ARTIST
)
export const MAX_SIDEBAR_PLAYLISTS = 100

View File

@ -13,7 +13,7 @@ import { BiCog } from 'react-icons/all'
import { useDrop } from 'react-dnd'
import SubMenu from './SubMenu'
import { isWritable } from '../common'
import { DraggableTypes } from '../consts'
import { DraggableTypes, MAX_SIDEBAR_PLAYLISTS } from '../consts'
const PlaylistMenuItemLink = ({ pls, sidebarIsOpen }) => {
const dataProvider = useDataProvider()
@ -56,7 +56,7 @@ const PlaylistsSubMenu = ({ state, setState, sidebarIsOpen, dense }) => {
payload: {
pagination: {
page: 0,
perPage: 0,
perPage: MAX_SIDEBAR_PLAYLISTS,
},
sort: { field: 'name' },
},