Skip to content
Snippets Groups Projects
Commit 10a0419b authored by Johanna Szepanski's avatar Johanna Szepanski Committed by EREBUS_DMN\jsz
Browse files

conditionally fetch alerts based on hideAlerts props

parent bb1f6e67
No related branches found
No related tags found
2 merge requests!542Prepare 4.1.0,!521CE-3061: Update ioc alerts and status separately
...@@ -10,7 +10,7 @@ function createRequest(id) { ...@@ -10,7 +10,7 @@ function createRequest(id) {
}; };
} }
export const IOCStatus = ({ id }) => { export const IOCStatus = ({ id, hideAlerts }) => {
const client = useContext(apiContext); const client = useContext(apiContext);
const params = useMemo(() => createRequest(id), [id]); const params = useMemo(() => createRequest(id), [id]);
...@@ -35,12 +35,14 @@ export const IOCStatus = ({ id }) => { ...@@ -35,12 +35,14 @@ export const IOCStatus = ({ id }) => {
}); });
useEffect(() => { useEffect(() => {
callFetchIocAlerts(); if (!hideAlerts) {
callFetchIocAlerts();
}
return () => { return () => {
abortCallFetchIocAlerts(); abortCallFetchIocAlerts();
}; };
}, [iocStateStatus]); }, [iocStateStatus, hideAlerts]);
return ( return (
<Grid <Grid
...@@ -59,6 +61,7 @@ export const IOCStatus = ({ id }) => { ...@@ -59,6 +61,7 @@ export const IOCStatus = ({ id }) => {
<Status <Status
state={iocStateStatus} state={iocStateStatus}
alert={iocAlert} alert={iocAlert}
hideAlerts={hideAlerts}
/> />
)} )}
</Grid> </Grid>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment