From 30ac5c7fd781285393c8ac7d810ea1217a7a66ad Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 12 Sep 2023 10:15:56 +0700
Subject: Fix error when no category homepage data

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

(limited to 'src/lib/home/components/CategoryHome.jsx')

diff --git a/src/lib/home/components/CategoryHome.jsx b/src/lib/home/components/CategoryHome.jsx
index 181ba327..34c28728 100644
--- a/src/lib/home/components/CategoryHome.jsx
+++ b/src/lib/home/components/CategoryHome.jsx
@@ -7,7 +7,7 @@ const CategoryHome = ({ id }) => {
 
   return (
     <div className='p-4 sm:py-8 relative bg-gray-100 border border-gray-200 min-h-[240px]'>
-      {categoryHome.data ? (
+      {categoryHome?.data?.length > 0 ? (
         <ProductSlider
           products={{
             products: categoryHome.data?.[0].products,
-- 
cgit v1.2.3

