From 3ab4557241c010a5110e42759fd36291e6207071 Mon Sep 17 00:00:00 2001 From: matteobelin Date: Thu, 20 Jun 2024 10:14:06 +0200 Subject: [PATCH] fix:deconnexion socket --- front/src/components/JoinGP.vue | 3 ++- front/src/helpers/socketHelper.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/front/src/components/JoinGP.vue b/front/src/components/JoinGP.vue index 69e4f04..3d1b47a 100644 --- a/front/src/components/JoinGP.vue +++ b/front/src/components/JoinGP.vue @@ -8,7 +8,8 @@ import socketHelper from '@/helpers/socketHelper'; const roomId = ref(''); const showToast = useUtilsStore().showToast; -socketHelper.disconnect() +socketHelper.disconnect(); + interface JoinRoomResponse { success: boolean; data: { diff --git a/front/src/helpers/socketHelper.ts b/front/src/helpers/socketHelper.ts index 375ee30..67b953f 100644 --- a/front/src/helpers/socketHelper.ts +++ b/front/src/helpers/socketHelper.ts @@ -60,9 +60,11 @@ const invalidToken = () => { }; const disconnect=()=>{ socket.disconnect(); + socket.connect(); } + export default { joinRoom, message, messageResponse,quitRoom,invalidToken,joinLobby,handleJoinedRoom,handleChef,disconnect}