This commit is contained in:
hackerESQ
2024-08-27 21:17:54 -05:00
parent db01c27113
commit e21814714d
11 changed files with 129 additions and 41 deletions
@@ -11,6 +11,7 @@ new class extends Component {
public Collection $transactions;
public ?Portfolio $portfolio;
public ?Transaction $editingTransaction;
public Bool $shouldGoToHolding = true;
protected $listeners = [
'transaction-updated' => '$refresh',
@@ -24,6 +25,11 @@ new class extends Component {
$this->dispatch('toggle-manage-transaction');
}
public function goToHolding($holding)
{
return $this->redirect(route('holding.show', ['portfolio' => $holding['portfolio_id'], 'symbol' => $holding['symbol']]));
}
}; ?>
<div class="">
@@ -36,6 +42,12 @@ new class extends Component {
class="cursor-pointer"
x-data="{ loading: false, timeout: null }"
@click="
if ($wire.shouldGoToHolding) {
$wire.goToHolding({{ $transaction }})
return;
}
timeout = setTimeout(() => { loading = true }, 200);
$wire.showTransactionDialog('{{ $transaction->id }}').then(() => {
clearTimeout(timeout);