Commit 64768c25 authored by PDuarte's avatar PDuarte

menuPages reload fix

parent db164d0e
...@@ -152,13 +152,6 @@ const handleError = (text) => { ...@@ -152,13 +152,6 @@ const handleError = (text) => {
q: null q: null
})) }))
} }
if (playlistsStore.allDataPlaylists === null || playlistsStore.allDataPlaylists.length < 1) {
dispatch(getData_playlists({
start: 0,
length: 1000,
q: ''
}))
}
}, [dispatch]) }, [dispatch])
useEffect(() => { useEffect(() => {
setPagetypes(settingStore.allDataPagetypes) setPagetypes(settingStore.allDataPagetypes)
...@@ -178,6 +171,18 @@ const handleError = (text) => { ...@@ -178,6 +171,18 @@ const handleError = (text) => {
setLayoumenu(screensStore.allDataLayoutMenus) setLayoumenu(screensStore.allDataLayoutMenus)
}, [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 ( return (
<Fragment> <Fragment>
<Form <Form
......
...@@ -161,7 +161,7 @@ const ManagePlaylist = ({dataElement, selectedDataElement, handleChange}) => { ...@@ -161,7 +161,7 @@ const ManagePlaylist = ({dataElement, selectedDataElement, handleChange}) => {
getData={getData_avaliablePlaylists} getData={getData_avaliablePlaylists}
serverSideColumns={serverSideColumnsRight} serverSideColumns={serverSideColumnsRight}
// linkAddButton={`/add`} // linkAddButton={`/add`}
total={store.totalPlaylists} total={avaliablePlaylists.length}
/> />
</Col> </Col>
......
...@@ -23,12 +23,17 @@ const _getData_playlists = params => { ...@@ -23,12 +23,17 @@ const _getData_playlists = params => {
} }
} }
export 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 = { const newparams = {
...params, ...params,
idproject: !currentProject ? '%' : currentProject.value idproject: !currentProject ? '%' : currentProject.value
} }
return _getData_playlists(newparams) 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