Fix prompt on initial render

This commit is contained in:
soupette 2019-12-04 17:14:53 +01:00
parent 410073dc05
commit 7358d7eaf2

View File

@ -56,6 +56,14 @@ const ListPage = () => {
}
}, [search]);
// Disabling the prompt on the first render if one of the modal is open
useEffect(() => {
if (search !== '') {
togglePrompt(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const attributes = get(modifiedData, mainDataTypeAttributesPath, {});
const attributesLength = Object.keys(attributes).length;