From f20d4bdf0cf4acc65ae634eb3a58ecd976275c77 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 17 Oct 2023 15:26:51 +0700
Subject: handle arrow back browser di page checkout

---
 src/lib/checkout/components/Checkout.jsx | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'src/lib/checkout/components/Checkout.jsx')

diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index 511fcdba..c78757a0 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -168,6 +168,16 @@ const Checkout = () => {
       setExpedisi(dataExpedisi)
     }
     loadExpedisi()
+
+    const handlePopState = () => {
+      router.push('/shop/cart')
+    }
+
+    window.onpopstate = handlePopState
+
+    return () => {
+      window.onpopstate = null
+    }
     // voucher()
   }, [])
 
-- 
cgit v1.2.3

