From 9595223471946520f5c156e24eceb577fae4c901 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 4 Aug 2023 13:36:47 +0700 Subject: add backgorund image mobile --- src/lib/product/components/Product/ProductMobile.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index f0264542..d25d0861 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -45,7 +45,9 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { useEffect(() => { const getBackgound = async () => { const get = await odooApi('GET', '/api/v1/banner?type=flash-sale-background-banner') - setBackgorundFlashSale(get[0].image) + if (get.length > 0) { + setBackgorundFlashSale(get[0].image) + } } getBackgound() }, []) @@ -171,7 +173,11 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { {product?.flashSale?.remainingTime > 0 && (
- +
-- cgit v1.2.3