From f76e84461aed2597c0ae2e301bf8f11038f0315b Mon Sep 17 00:00:00 2001 From: Pheuw1 Date: Sat, 18 Mar 2023 21:18:56 +0100 Subject: [PATCH] socket emit in the wrong place --- front/volume/src/components/Chat.svelte | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/front/volume/src/components/Chat.svelte b/front/volume/src/components/Chat.svelte index 76140aa..212923e 100644 --- a/front/volume/src/components/Chat.svelte +++ b/front/volume/src/components/Chat.svelte @@ -52,9 +52,6 @@ }); onDestroy(() => { - socket.emit("LeaveChanel", async (response) => { - console.log(response.status); - }); clearInterval(usersInterval) socket.disconnect(); }); @@ -290,8 +287,10 @@ const leaveChannel = async () => { await show_popup("Press \"Okay\" to leave this channel?", false); if ($content == 'ok') { - socket.emit('leaveChannel'); - } + socket.emit("LeaveChanel", async (response) => { + console.log(response.status); + }); + } } function onSendMessage() { dispatch("send-message", selectedUser);