From 533f8a53ba063d645a8612ff454ee9ad2b0f5b11 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Mon, 3 Dec 2018 22:11:44 +0100 Subject: [PATCH] wip --- resources/views/dashboard.blade.php | 4 ++-- src/WebSockets/Channels/PresenceChannel.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 9d755f2..906db2a 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -102,7 +102,7 @@ methods: { connect() { - this.pusher = new Pusher(this.app.appKey, { + this.pusher = new Pusher(this.app.key, { wsHost: window.location.hostname, wsPort: this.port, disableStats: true, @@ -148,7 +148,7 @@ }, subscribeToChannel(channel) { - this.pusher.subscribe('{{ \BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Dashboard::LOG_CHANNEL_PREFIX }}' + channel) + this.pusher.subscribe('{{ \BeyondCode\LaravelWebSockets\Dashboard\DashboardLogger::LOG_CHANNEL_PREFIX }}' + channel) .bind('log-message', (data) => { this.logs.push(data); }); diff --git a/src/WebSockets/Channels/PresenceChannel.php b/src/WebSockets/Channels/PresenceChannel.php index 3d686c7..1d5ee99 100644 --- a/src/WebSockets/Channels/PresenceChannel.php +++ b/src/WebSockets/Channels/PresenceChannel.php @@ -44,6 +44,10 @@ class PresenceChannel extends Channel { parent::unsubscribe($connection); + if (! isset($this->users[$connection->socketId])) { + return; + } + $this->broadcastToOthers($connection, [ 'event' => 'pusher_internal:member_removed', 'channel' => $this->channelName,