Commit 64768c25 authored by PDuarte's avatar PDuarte

menuPages reload fix

parent db164d0e
......@@ -151,14 +151,7 @@ const handleError = (text) => {
length: 1000,
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,13 +23,18 @@ const _getData_playlists = params => {
}
}
export const getData_playlists = params => {
const currentProject = store.getState().navbar.projectCurrent
const newparams = {
...params,
idproject: !currentProject ? '%' : currentProject.value
}
return _getData_playlists(newparams)
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)
}
export const addplaylist = params => {
......
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