summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2025-04-28 08:46:44 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2025-04-28 08:46:44 +0700
commit5077cf5ac59e15529de1abab43b4a49a4722bd2d (patch)
tree8b2fa57ae944a60b32d96e8078575c4d9a033ef6
parent71ca9d6c85871b6bcb2976ed4911032aab4d32e7 (diff)
handlig cache sla pengiriman
-rw-r--r--src-migrate/modules/product-detail/components/Information.tsx6
-rw-r--r--src/lib/checkout/components/SectionExpedition.jsx4
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;
}