From 58e8c5b5e3faf5bed973e19d8be036c1e7d004bc Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 6 Jan 2025 15:23:01 +0700
Subject: <iman> update code duration

---
 src/lib/flashSale/components/FlashSale.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/flashSale/components/FlashSale.jsx')

diff --git a/src/lib/flashSale/components/FlashSale.jsx b/src/lib/flashSale/components/FlashSale.jsx
index 715c25c5..9c0e713b 100644
--- a/src/lib/flashSale/components/FlashSale.jsx
+++ b/src/lib/flashSale/components/FlashSale.jsx
@@ -24,7 +24,7 @@ const FlashSale = () => {
       const { data } = await res.json();
       if (data) {
         setFlashSales(data);
-        const remainingTime = calculateRemainingTime(data[0].endDate);
+        const remainingTime = calculateRemainingTime(data[0]?.endDate);
         setDuration(remainingTime);
       }
       setIsLoading(false);
-- 
cgit v1.2.3

