diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-03 17:12:41 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-03 17:12:41 +0700 |
| commit | 38294c28a5f9cfd0b3fdb13204beebefe537d2f7 (patch) | |
| tree | 2a3b9218fc439c6b805fe0f76e68bacaf8c3ec16 /src/components | |
| parent | cd01ba82733062db99075ad7690bdb52fb85745a (diff) | |
no message
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/products/ProductCategories.js | 8 |
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}> |
