mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
Livewire rebuilds listener names from the session team on every event call. After a team switch in another tab, open pages still listen on the old team channel, so events failed with EventHandlerDoesNotExist (500), or ran handlers that load resources scoped to the new team (404). Store the team at mount and build team channel listeners from it. Events for a team that is no longer the session team are ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
511 B
PHP
29 lines
511 B
PHP
<?php
|
|
|
|
namespace App\Livewire;
|
|
|
|
use App\Traits\ListensToTeamChannel;
|
|
use Livewire\Component;
|
|
|
|
class LayoutPopups extends Component
|
|
{
|
|
use ListensToTeamChannel;
|
|
|
|
public function getListeners()
|
|
{
|
|
return $this->teamChannelListeners([
|
|
'TestEvent' => 'testEvent',
|
|
]);
|
|
}
|
|
|
|
public function testEvent()
|
|
{
|
|
$this->dispatch('success', 'Realtime events configured!');
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.layout-popups');
|
|
}
|
|
}
|