summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/product/components/Product/ProductMobile.jsx10
1 files changed, 8 insertions, 2 deletions
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 && (
<div className={`absolute bottom-0 w-full`}>
<div className='absolute bottom-0 w-full'>
- <ImageNext src={backgorundFlashSale || '/images/GAMBAR-BG-FLASH-SALE.jpg'} width={1000} height={100} />
+ <ImageNext
+ src={backgorundFlashSale || '/images/GAMBAR-BG-FLASH-SALE.jpg'}
+ width={1000}
+ height={100}
+ />
</div>
<div className='relative'>
<div className='flex gap-x-2 items-center p-2'>