diff --git a/app/Livewire/BillingPortal/Purchase.php b/app/Livewire/BillingPortal/Purchase.php index 8e70261fa15e..96762313a13a 100644 --- a/app/Livewire/BillingPortal/Purchase.php +++ b/app/Livewire/BillingPortal/Purchase.php @@ -52,12 +52,16 @@ class Purchase extends Component #[On('purchase.context')] public function handleContext(string $property, $value): self { + $clone = $this->context; + data_set($this->context, $property, $value); // The following may not be needed, as we can pass arround $context. // cache()->set($this->hash, $this->context); - $this->id = Str::uuid(); + if ($clone !== $this->context) { + $this->id = Str::uuid(); + } return $this; } @@ -86,6 +90,18 @@ class Purchase extends Component return $this->steps[$this->step]; } + #[Computed()] + public function componentUniqueId(): string + { + return "purchase-{$this->id}"; + } + + #[Computed()] + public function summaryUniqueId(): string + { + return "summary-{$this->id}"; + } + public function mount() { $this->id = Str::uuid();