diff --git a/app/Livewire/Flow2/InvoicePay.php b/app/Livewire/Flow2/InvoicePay.php index 2461d2663b..61482050ee 100644 --- a/app/Livewire/Flow2/InvoicePay.php +++ b/app/Livewire/Flow2/InvoicePay.php @@ -159,10 +159,6 @@ class InvoicePay extends Component $this->setContext('fields', $fields); // $this->context['fields'] = $fields; - if ($company_gateway->always_show_required_fields) { - return $this->required_fields = true; - } - /** @var \App\Models\ClientContact $contact */ $contact = $this->getContext()['contact']; @@ -184,6 +180,10 @@ class InvoicePay extends Component } } } + + if ($company_gateway->always_show_required_fields) { + return $this->required_fields = true; + } return $this->required_fields = false; diff --git a/app/Livewire/Flow2/RequiredFields.php b/app/Livewire/Flow2/RequiredFields.php index ce21e40c65..ee637558c3 100644 --- a/app/Livewire/Flow2/RequiredFields.php +++ b/app/Livewire/Flow2/RequiredFields.php @@ -96,13 +96,16 @@ class RequiredFields extends Component /** @var \App\Models\ClientContact $contact */ $rff->check($contact); - if ($rff->unfilled_fields === 0) { + if ($rff->unfilled_fields === 0 && !$this->company_gateway->always_show_required_fields) $this->dispatch('required-fields'); - } - - if ($rff->unfilled_fields > 0) { + else $this->is_loading = false; - } + + // } + + // if ($rff->unfilled_fields > 0) { + // $this->is_loading = false; + // } } public function handleSubmit(array $data)