From 876c4f9d4953748b6227605020c5e4767d003e84 Mon Sep 17 00:00:00 2001 From: dikapratana Date: Mon, 26 Jan 2026 09:45:26 +0700 Subject: [PATCH] fix submit setup --- src/features/settings/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/features/settings/index.tsx b/src/features/settings/index.tsx index d3c7c26..96dea55 100644 --- a/src/features/settings/index.tsx +++ b/src/features/settings/index.tsx @@ -35,14 +35,16 @@ function handleSubmit(e: React.FormEvent) { e.preventDefault(); const merchant = getMerchant(); - if (!merchant || !form) return; - if (!isFormValid) return; - const isDifferent = isObjectValueDifferent(merchant, form); + if(merchant){ + const isDifferent = isObjectValueDifferent(merchant, form); + if (isDifferent) { + clearDevice(); // reset device kalau merchant berubah + } - if (isDifferent) { - clearDevice(); // reset device kalau merchant berubah } + + setLoading(true); saveMerchant(form);