fix submit setup
This commit is contained in:
@@ -35,15 +35,17 @@ 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