From a65a18953cc966eb37c10df00d73d3538570b9ba Mon Sep 17 00:00:00 2001 From: Gagan Suie Date: Sun, 5 May 2024 13:32:06 -0500 Subject: [PATCH] Fix: removed readyState check --- src/routes/channel/[channelId]/+page.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/channel/[channelId]/+page.svelte b/src/routes/channel/[channelId]/+page.svelte index f6a41ed8..6e9b2534 100644 --- a/src/routes/channel/[channelId]/+page.svelte +++ b/src/routes/channel/[channelId]/+page.svelte @@ -144,7 +144,6 @@ if (ch.socket && ch.socket.constructor === WebSocket) ch.socket.close() }) channels = [] - channel = null }) const disableSharing = () => { @@ -255,7 +254,7 @@ console.log(data) //if manually closed, don't reconnect - if (data.code === 1005 && channel.socket.readyState >= WebSocket.CLOSING) { + if (data.code === 1005) { clearInterval(platformPollingInterval) platformPollingInterval = null return @@ -270,7 +269,6 @@ const attemptReconnect = () => { setTimeout(async () => { - if (!$page.params.channelId) return channel = channels.find((ch: any) => ch._id === parseInt($page.params.channelId)) if (channel) { console.log('Reconnecting to WebSocket...')