From ec5edd02c4c80b1e5a21853eeed0be618b33fb29 Mon Sep 17 00:00:00 2001 From: onam Date: Fri, 29 Sep 2023 19:24:19 +0530 Subject: [PATCH] fix: category filter error --- src/pages/ProductInfo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/ProductInfo.tsx b/src/pages/ProductInfo.tsx index afb2f48..a470f0f 100644 --- a/src/pages/ProductInfo.tsx +++ b/src/pages/ProductInfo.tsx @@ -68,11 +68,11 @@ const ProductInfo = ({ id }: Props) => { (item) => item?.variant.product_id === product.value?.id ); - const categories = product.value?.categories.filter( + const categories = product.value?.categories?.filter( (cate) => !cate.handle.startsWith("loc:") ); const locations = product.value?.categories - .filter((cate) => cate.handle.startsWith("loc:")) + ?.filter((cate) => cate.handle.startsWith("loc:")) .sort( (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()