mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
feat: update payment status handling in profile view
Removed the 'paid' state and replaced its usage with 'currentYearIsPaid' state in profile view. This change improves the accuracy of payment status tracking. Also, added a line to refresh the 'currentPleb' object after creating a PaymentEvent and set 'qrCode' to null when the current year is paid.
This commit is contained in:
@@ -29,7 +29,6 @@ state(['events' => []]);
|
||||
state(['payments' => []]);
|
||||
state(['invoice' => null]);
|
||||
state(['qrCode' => null]);
|
||||
state(['paid' => false]);
|
||||
state(['amountToPay' => 1]);
|
||||
state(['currentYearIsPaid' => false]);
|
||||
state(['currentPubkey' => null]);
|
||||
@@ -63,6 +62,7 @@ on([
|
||||
}
|
||||
if ($this->currentPleb->paymentEvents->count() < 1) {
|
||||
$this->createPaymentEvent();
|
||||
$this->currentPleb->refresh();
|
||||
}
|
||||
$this->loadEvents();
|
||||
$this->searchPaymentEvent();
|
||||
@@ -70,7 +70,7 @@ on([
|
||||
]);
|
||||
|
||||
$listenForPayment = function () {
|
||||
if (!$this->paid) {
|
||||
if (!$this->currentYearIsPaid) {
|
||||
$this->searchPaymentEvent();
|
||||
}
|
||||
};
|
||||
@@ -127,10 +127,9 @@ $searchPaymentEvent = function () {
|
||||
);
|
||||
|
||||
if ($this->currentYearIsPaid) {
|
||||
$this->qrCode = null;
|
||||
$this->currentPleb->paymentEvents->first()->update(['paid' => true]);
|
||||
}
|
||||
|
||||
$this->paid = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user