From 7df6890920e2a002d8e5161ba90b598b2b6a8f34 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:34:27 +0200 Subject: [PATCH] refactor(terminal-connection): streamline auto-connection logic and improve component readiness checks --- .../Shared/ExecuteContainerCommand.php | 3 +- .../execute-container-command.blade.php | 41 ++++++++----------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/app/Livewire/Project/Shared/ExecuteContainerCommand.php b/app/Livewire/Project/Shared/ExecuteContainerCommand.php index 9891808b3..40004354f 100644 --- a/app/Livewire/Project/Shared/ExecuteContainerCommand.php +++ b/app/Livewire/Project/Shared/ExecuteContainerCommand.php @@ -168,11 +168,10 @@ class ExecuteContainerCommand extends Component $this->connectionStatus = 'Waiting for terminal to be ready...'; } - #[On('initializeTerminalConnection')] public function initializeTerminalConnection() { // Only auto-connect if containers are loaded and we haven't attempted before - if (! $this->containersLoaded || $this->autoConnectAttempted) { + if (! $this->containersLoaded || $this->autoConnectAttempted || $this->isConnecting) { return; } diff --git a/resources/views/livewire/project/shared/execute-container-command.blade.php b/resources/views/livewire/project/shared/execute-container-command.blade.php index f40a1c82f..768680ec3 100644 --- a/resources/views/livewire/project/shared/execute-container-command.blade.php +++ b/resources/views/livewire/project/shared/execute-container-command.blade.php @@ -106,36 +106,27 @@ @endscript