This commit is contained in:
Maieul BOYER 2025-11-24 17:00:23 +01:00 committed by Maix0
parent 0358a6025b
commit deaf58dfce
7 changed files with 19 additions and 17 deletions

View file

@ -6,6 +6,12 @@ import { getUser, updateUser } from "@app/auth";
import io, { Socket } from 'socket.io-client';
let __socket: Socket | undefined = undefined;
document.addEventListener('ft:pageChange', () => {
if (__socket !== undefined)
__socket.close();
__socket = undefined;
console.log("Page changed");
})
function getSocket(): Socket {
if (__socket === undefined)
__socket = io("wss://localhost:8888", {