Improvements fo reactivity

This commit is contained in:
David Bomba 2024-07-02 15:06:45 +10:00 committed by Benjamin Beganović
parent ae2bf51028
commit 6983104f40
2 changed files with 10 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class PaymentMethod extends Component
public $methods = [];
public $isLoading = false;
public $isLoading = true;
public $amount = 0;

View File

@ -88,6 +88,9 @@ class InvoicePay extends Component
#[On('payment-method-selected')]
public function paymentMethodSelected($company_gateway_id, $gateway_type_id, $amount)
{
nlog("payment method selected inside InvoicePay");
$this->payment_method_accepted = true;
$this->context['company_gateway_id'] = $company_gateway_id;
$this->context['gateway_type_id'] = $gateway_type_id;
@ -98,8 +101,7 @@ class InvoicePay extends Component
$this->context['invitation_id'] = $this->invitation_id;
// $this->invite = \App\Models\InvoiceInvitation::withTrashed()->find($this->invitation_id)->withoutRelations();
$this->payment_method_accepted =true;
$this->component();
}
@ -119,13 +121,16 @@ class InvoicePay extends Component
return PaymentMethod::class;
// if($this->ready)
nlog("computed");
return ProcessPayment::class;
}
#[Computed()]
public function componentUniqueId(): string
{
return "purchase-".md5(time());
return "purchase-".md5(microtime());
}
public function mount()