From d7d049c0a699e27d5acea163b6df09f6f2b0b5e3 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 26 Jul 2023 10:33:21 +0700
Subject: fixing voucher

---
 src/lib/checkout/components/Checkout.jsx | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

(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 11a14e31..92917d54 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -104,11 +104,13 @@ const Checkout = () => {
   const expedisiValidation = useRef(null)
 
   const voucher = async () => {
-    try {
-      let dataVoucher = await getVoucher(auth?.id)
-      SetListVoucher(dataVoucher)
-    } finally {
-      setLoadingVoucher(false)
+    if (!listVouchers) {
+      try {
+        let dataVoucher = await getVoucher(auth?.id)
+        SetListVoucher(dataVoucher)
+      } finally {
+        setLoadingVoucher(false)
+      }
     }
   }
   const VoucherCode = async (code) => {
-- 
cgit v1.2.3

