fix submit setup
This commit is contained in:
1 parent
739b00e07a
commit
876c4f9d49
1 file changed
+7
-5
@@ -35,14 +35,16 @@ function handleSubmit(e: React.FormEvent) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const merchant = getMerchant();
|
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);
|
setLoading(true);
|
||||||
saveMerchant(form);
|
saveMerchant(form);
|
||||||
|
|||||||
Reference in new issue
Block a user