summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/products/ProductCategories.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/products/ProductCategories.js b/src/components/products/ProductCategories.js
index dc1325b7..14817039 100644
--- a/src/components/products/ProductCategories.js
+++ b/src/components/products/ProductCategories.js
@@ -42,11 +42,13 @@ export default function ProductCategories() {
useEffect(() => {
const getContentIds = async () => {
- const dataContentIds = await apiOdoo('GET', '/api/v1/categories_homepage/ids');
- setContentIds(dataContentIds);
+ if (contentIds.length == 0) {
+ const dataContentIds = await apiOdoo('GET', '/api/v1/categories_homepage/ids');
+ setContentIds(dataContentIds);
+ }
}
getContentIds();
- }, []);
+ }, [ contentIds ]);
return contentIds.map((contentId) => (
<LazyLoadComponent key={contentId}>