diff --git a/app/Http/Livewire/Chat/HighscoreChat.php b/app/Http/Livewire/Chat/HighscoreChat.php index 4b9f2441..2a4060f8 100644 --- a/app/Http/Livewire/Chat/HighscoreChat.php +++ b/app/Http/Livewire/Chat/HighscoreChat.php @@ -39,8 +39,10 @@ class HighscoreChat extends Component public function chatMessageSent() { - $this->messages = cache()->get('highscore_chat_messages', []); - $this->dispatchBrowserEvent('chat-updated'); + if (auth()->check()) { + $this->messages = cache()->get('highscore_chat_messages', []); + $this->dispatchBrowserEvent('chat-updated'); + } } public function sendMessage()