mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-18 06:22:25 +03:00
clear websocket when it closes
This commit is contained in:
parent
856e4c66e2
commit
1de7e53ac4
@ -23,7 +23,7 @@ const websocketSend = async (type, data) => {
|
|||||||
if (!ws) {
|
if (!ws) {
|
||||||
console.log("no websocket. creating now...");
|
console.log("no websocket. creating now...");
|
||||||
ws = Websocket.create();
|
ws = Websocket.create();
|
||||||
console.log(ws);
|
console.log(ws ? "Successfully created websocket" : "Failed to create websocket");
|
||||||
}
|
}
|
||||||
|
|
||||||
const encryptedData = await Utilities.encryptWithSecret(
|
const encryptedData = await Utilities.encryptWithSecret(
|
||||||
|
@ -33,10 +33,12 @@ export const create = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ws.on("close", () => {
|
ws.on("close", () => {
|
||||||
|
global.websocket = null;
|
||||||
console.log(global.websocket);
|
console.log(global.websocket);
|
||||||
console.log("Websocket disconnected");
|
console.log("Websocket disconnected");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("Websocket server started");
|
||||||
NodeLogging.log(`Websocket server started`);
|
NodeLogging.log(`Websocket server started`);
|
||||||
|
|
||||||
global.websocket = ws;
|
global.websocket = ws;
|
||||||
|
Loading…
Reference in New Issue
Block a user