From 38294c28a5f9cfd0b3fdb13204beebefe537d2f7 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 3 Feb 2023 17:12:41 +0700 Subject: no message --- src/components/products/ProductCategories.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/components/products') 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) => ( -- cgit v1.2.3