update
This commit is contained in:
parent
0358a6025b
commit
deaf58dfce
7 changed files with 19 additions and 17 deletions
|
|
@ -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", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue