diff --git a/app/Http/Livewire/BlockTable.php b/app/Http/Livewire/BlockTable.php index dde693b8f8..1b60e78257 100644 --- a/app/Http/Livewire/BlockTable.php +++ b/app/Http/Livewire/BlockTable.php @@ -15,6 +15,9 @@ final class BlockTable extends Component { use HasPagination; + /** @phpstan-ignore-next-line */ + protected $listeners = ['currencyChanged' => '$refresh']; + public function render(): View { return view('livewire.block-table', [ diff --git a/app/Http/Livewire/BlockTransactionsTable.php b/app/Http/Livewire/BlockTransactionsTable.php index 8c80db1121..588a5f1c15 100644 --- a/app/Http/Livewire/BlockTransactionsTable.php +++ b/app/Http/Livewire/BlockTransactionsTable.php @@ -16,6 +16,9 @@ final class BlockTransactionsTable extends Component public string $blockId; + /** @phpstan-ignore-next-line */ + protected $listeners = ['currencyChanged' => '$refresh']; + public function mount(string $blockId): void { $this->blockId = $blockId; diff --git a/app/Http/Livewire/LatestRecords.php b/app/Http/Livewire/LatestRecords.php index d6651fea8b..2df364dd26 100644 --- a/app/Http/Livewire/LatestRecords.php +++ b/app/Http/Livewire/LatestRecords.php @@ -16,6 +16,9 @@ final class LatestRecords extends Component use ManagesLatestBlocks; use ManagesLatestTransactions; + /** @phpstan-ignore-next-line */ + protected $listeners = ['currencyChanged' => 'currencyChanged']; + public array $state = [ 'selected' => 'transactions', 'type' => 'all', @@ -34,6 +37,15 @@ public function render(): View return $this->renderTransactions(); } + public function currencyChanged(): void + { + if ($this->state['selected'] === 'blocks') { + $this->pollBlocks(); + } else { + $this->pollTransactions(); + } + } + private function renderBlocks(): View { if (is_null($this->blocks)) { diff --git a/app/Http/Livewire/TransactionTable.php b/app/Http/Livewire/TransactionTable.php index a015f117c4..57b38fe90a 100644 --- a/app/Http/Livewire/TransactionTable.php +++ b/app/Http/Livewire/TransactionTable.php @@ -15,6 +15,9 @@ final class TransactionTable extends Component { use HasPagination; + /** @phpstan-ignore-next-line */ + protected $listeners = ['currencyChanged' => '$refresh']; + public array $state = [ 'type' => 'all', ]; diff --git a/app/Http/Livewire/WalletBalance.php b/app/Http/Livewire/WalletBalance.php index 358f8947a0..e5c1cf5b8e 100644 --- a/app/Http/Livewire/WalletBalance.php +++ b/app/Http/Livewire/WalletBalance.php @@ -12,6 +12,11 @@ final class WalletBalance extends Component { + /** @phpstan-ignore-next-line */ + protected $listeners = [ + 'currencyChanged' => '$refresh', + ]; + public string $walletAddress; public function mount(Wallet $wallet): void diff --git a/app/Http/Livewire/WalletTransactionTable.php b/app/Http/Livewire/WalletTransactionTable.php index 8f607a2b0e..36cefa5de0 100644 --- a/app/Http/Livewire/WalletTransactionTable.php +++ b/app/Http/Livewire/WalletTransactionTable.php @@ -28,6 +28,7 @@ final class WalletTransactionTable extends Component /** @phpstan-ignore-next-line */ protected $listeners = [ 'filterTransactionsByDirection', + 'currencyChanged' => '$refresh', ]; public function mount(string $address, bool $isCold, ?string $publicKey): void diff --git a/app/Http/Livewire/WalletVoterTable.php b/app/Http/Livewire/WalletVoterTable.php index 39f47a241e..9dc2b56eb6 100644 --- a/app/Http/Livewire/WalletVoterTable.php +++ b/app/Http/Livewire/WalletVoterTable.php @@ -15,6 +15,9 @@ final class WalletVoterTable extends Component { use HasPagination; + /** @phpstan-ignore-next-line */ + protected $listeners = ['currencyChanged' => '$refresh']; + public string $publicKey; public string $username; diff --git a/resources/views/components/tables/desktop/blocks.blade.php b/resources/views/components/tables/desktop/blocks.blade.php index 3061c3f648..f60fdef692 100644 --- a/resources/views/components/tables/desktop/blocks.blade.php +++ b/resources/views/components/tables/desktop/blocks.blade.php @@ -14,7 +14,7 @@
@foreach($blocks as $block) -