forked from eatvio/eatvio-infra
meeting the requirements of a static analyzer
This commit is contained in:
@@ -2,27 +2,17 @@
|
||||
|
||||
namespace App\Livewire\Chat;
|
||||
|
||||
use Livewire\Component;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Tracker extends Component
|
||||
{
|
||||
public bool $showNewMessageNotifycation = false;
|
||||
public int|bool $showNewMessageNotifycation = false;
|
||||
|
||||
public array $myMessages = [];
|
||||
|
||||
// Special Syntax: ['echo:{channel},{event}' => '{method}']
|
||||
/**
|
||||
* some Listeners
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* */
|
||||
protected $listeners = ['echo:direct-chat,ChatMessageUpdated' => 'notifyNewMessage'];
|
||||
|
||||
public function notifyNewMessage(mixed $payload): void
|
||||
public function notifyNewMessage(string $payload): void
|
||||
{
|
||||
$this->myMessages[] = $payload;
|
||||
$this->showNewMessageNotifycation = true;
|
||||
@@ -32,4 +22,9 @@ class Tracker extends Component
|
||||
{
|
||||
return view('livewire.chat.tracker');
|
||||
}
|
||||
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['echo:direct-chat,ChatMessageUpdated' => 'notifyNewMessage'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user