fix submit setup
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user