Limit number of playlists displayed in the sidebar, to avoid UI freezes
This commit is contained in:
parent
2b105ca77b
commit
e673360087
2 changed files with 4 additions and 2 deletions
|
|
@ -18,3 +18,5 @@ DraggableTypes.ALL.push(
|
||||||
DraggableTypes.DISC,
|
DraggableTypes.DISC,
|
||||||
DraggableTypes.ARTIST
|
DraggableTypes.ARTIST
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export const MAX_SIDEBAR_PLAYLISTS = 100
|
||||||
|
|
|
||||||
|
|
@ -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' },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue