Commit 64768c25 authored by PDuarte's avatar PDuarte

menuPages reload fix

parent db164d0e
......@@ -152,13 +152,6 @@ const handleError = (text) => {
q: null
}))
}
if (playlistsStore.allDataPlaylists === null || playlistsStore.allDataPlaylists.length < 1) {
dispatch(getData_playlists({
start: 0,
length: 1000,
q: ''
}))
}
}, [dispatch])
useEffect(() => {
setPagetypes(settingStore.allDataPagetypes)
......@@ -178,6 +171,18 @@ const handleError = (text) => {
setLayoumenu(screensStore.allDataLayoutMenus)
}, [screensStore.allDataLayoutMenus])
useEffect(() => {
if (!dataElement) return
if (playlistsStore.allDataPlaylists === null || playlistsStore.allDataPlaylists.length < 1) {
dispatch(getData_playlists({
start: 0,
length: 1000,
idproject: dataElement.idproject,
q: ''
}))
}
}, [dataElement])
return (
<Fragment>
<Form
......
......@@ -161,7 +161,7 @@ const ManagePlaylist = ({dataElement, selectedDataElement, handleChange}) => {
getData={getData_avaliablePlaylists}
serverSideColumns={serverSideColumnsRight}
// linkAddButton={`/add`}
total={store.totalPlaylists}
total={avaliablePlaylists.length}
/>
</Col>
......
......@@ -23,12 +23,17 @@ const _getData_playlists = params => {
}
}
export const getData_playlists = params => {
const currentProject = store.getState().navbar.projectCurrent
if (!!params.idproject && params.idproject !== null) {
return _getData_playlists(params)
}
const currentProject = store.getState().navbar.projectCurrent
const newparams = {
...params,
idproject: !currentProject ? '%' : currentProject.value
}
return _getData_playlists(newparams)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment