diff --git a/app/Livewire/RealtimeConnection.php b/app/Livewire/RealtimeConnection.php index 59fb12ca4..89b680277 100644 --- a/app/Livewire/RealtimeConnection.php +++ b/app/Livewire/RealtimeConnection.php @@ -8,6 +8,7 @@ class RealtimeConnection extends Component { public $checkConnection = false; public $showNotification = false; + public $isNotificationEnabled = true; public function render() { return view('livewire.realtime-connection'); @@ -18,8 +19,7 @@ class RealtimeConnection extends Component $this->showNotification = false; } public function mount() { - $isRoot = auth()->user()->id === 0; - $showNotification = data_get(auth()->user(), 'is_notification_realtime_enabled'); - $this->checkConnection = $isRoot && $showNotification; + $this->isNotificationEnabled = auth()->user()->is_notification_realtime_enabled; + $this->checkConnection = auth()->user()->id === 0; } } diff --git a/resources/views/livewire/realtime-connection.blade.php b/resources/views/livewire/realtime-connection.blade.php index 46e3a1dfc..7ff23d096 100644 --- a/resources/views/livewire/realtime-connection.blade.php +++ b/resources/views/livewire/realtime-connection.blade.php @@ -8,28 +8,40 @@ if (window.Echo) { if (window.Echo.connector.pusher.connection.state !== 'connected') { checkNumber++; - if (checkNumber > 5) { - $wire.showNotification = true; + if (checkNumber > 4) { + @if ($isNotificationEnabled) + $wire.showNotification = true; + @endif + console.error( + 'Coolify could not connect to the new realtime service introduced in beta.154. This will cause unusual problems on the UI if not fixed! Please check the related documentation (https://coolify.io/docs/cloudflare-tunnels) or get help on Discord (https://coollabs.io/discord).)' + ); clearInterval(checkPusherInterval); } } else { console.log('Coolify is now connected to the new realtime service introduced in beta.154.'); clearInterval(checkPusherInterval); - $wire.showNotification = true; } } else { - $wire.showNotification = true; + @if ($isNotificationEnabled) + $wire.showNotification = true; + @endif + console.error( + 'Coolify could not connect to the new realtime service introduced in beta.154. This will cause unusual problems on the UI if not fixed! Please check the related documentation (https://coolify.io/docs/cloudflare-tunnels) or get help on Discord (https://coollabs.io/discord).)' + ); clearInterval(checkPusherInterval); } - }, 2000); + }, 1000); @endscript