mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Fixes for circular referece and re-rendering
This commit is contained in:
parent
0d2087dfc2
commit
5d9da26970
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user