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
+2
View File
@@ -18,3 +18,5 @@ DraggableTypes.ALL.push(
DraggableTypes.DISC, DraggableTypes.DISC,
DraggableTypes.ARTIST DraggableTypes.ARTIST
) )
export const MAX_SIDEBAR_PLAYLISTS = 100
+2 -2
View File
@@ -13,7 +13,7 @@ import { BiCog } from 'react-icons/all'
import { useDrop } from 'react-dnd' import { useDrop } from 'react-dnd'
import SubMenu from './SubMenu' import SubMenu from './SubMenu'
import { isWritable } from '../common' import { isWritable } from '../common'
import { DraggableTypes } from '../consts' import { DraggableTypes, MAX_SIDEBAR_PLAYLISTS } from '../consts'
const PlaylistMenuItemLink = ({ pls, sidebarIsOpen }) => { const PlaylistMenuItemLink = ({ pls, sidebarIsOpen }) => {
const dataProvider = useDataProvider() const dataProvider = useDataProvider()
@@ -56,7 +56,7 @@ const PlaylistsSubMenu = ({ state, setState, sidebarIsOpen, dense }) => {
payload: { payload: {
pagination: { pagination: {
page: 0, page: 0,
perPage: 0, perPage: MAX_SIDEBAR_PLAYLISTS,
}, },
sort: { field: 'name' }, sort: { field: 'name' },
}, },