From daa0b872601789815513508d48a14cbd8e1f6518 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 23 Dec 2024 13:39:47 +0700
Subject: <iman> update pengajuan tempo

---
 src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx')

diff --git a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
index 4bc04a3f..fc0f1c28 100644
--- a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
+++ b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
@@ -95,8 +95,6 @@ const InformasiPerusahaan = ({
 
   useEffect(() => {
     if (watchCity) {
-      updateForm('city', `${watchCity}`);
-      validate();
       const loadDistricts = async () => {
         let dataDistricts = await districtApi({ cityId: watchCity });
         dataDistricts = dataDistricts.map((district) => ({
@@ -105,9 +103,13 @@ const InformasiPerusahaan = ({
         }));
         setDistricts(dataDistricts);
       };
+      if (form.city !== `${watchCity}`) {
+        updateForm('city', `${watchCity}`);
+      }
+      validate();
       loadDistricts();
     }
-  }, [watchCity, setValue]);
+  }, [watchCity]);
 
   const watchDistrict = watch('district');
   useEffect(() => {
-- 
cgit v1.2.3

