From 5077cf5ac59e15529de1abab43b4a49a4722bd2d Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 28 Apr 2025 08:46:44 +0700 Subject: handlig cache sla pengiriman --- src-migrate/modules/product-detail/components/Information.tsx | 6 +++++- src/lib/checkout/components/SectionExpedition.jsx | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src-migrate/modules/product-detail/components/Information.tsx b/src-migrate/modules/product-detail/components/Information.tsx index d1f1e852..a7a58cbc 100644 --- a/src-migrate/modules/product-detail/components/Information.tsx +++ b/src-migrate/modules/product-detail/components/Information.tsx @@ -66,10 +66,14 @@ const Information = ({ product }: Props) => { }, [selectedVariant]); useEffect(() => { + if (isLoading){ + setSla(null); + } if (slaVariant) { setSla(slaVariant); } - }, [slaVariant]); + }, [slaVariant, isLoading]); + const handleOnChange = (vals: any) => { setDisableFilter(true); diff --git a/src/lib/checkout/components/SectionExpedition.jsx b/src/lib/checkout/components/SectionExpedition.jsx index b017c82e..40084048 100644 --- a/src/lib/checkout/components/SectionExpedition.jsx +++ b/src/lib/checkout/components/SectionExpedition.jsx @@ -32,8 +32,8 @@ function reverseMappingCourier(couriersOdoo, couriers, includeInstant = false) { const key = courier_code.toLowerCase(); if ( - !includeInstant && - ['hours'].includes(item.shipment_duration_unit.toLowerCase()) + !includeInstant && (['hours'].includes(item.shipment_duration_unit.toLowerCase()) || item.service_type == 'same_day') + ) { return acc; } -- cgit v1.2.3