Commit 64768c25 authored by PDuarte's avatar PDuarte

menuPages reload fix

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