mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 06:24:17 +00:00
Remove conditional spreading
This commit is contained in:
parent
12a741db39
commit
a0c45d9da4
1 changed files with 7 additions and 4 deletions
|
@ -64,15 +64,18 @@ Tools.connect = function () {
|
|||
|
||||
var url = new URL(window.location);
|
||||
var params = new URLSearchParams(url.search);
|
||||
var token = params.get("token");
|
||||
|
||||
this.socket = io.connect('', {
|
||||
...(token && {"query" : "token=" + token}),
|
||||
var socket_params = {
|
||||
"path": window.location.pathname.split("/boards/")[0] + "/socket.io",
|
||||
"reconnection": true,
|
||||
"reconnectionDelay": 100, //Make the xhr connections as fast as possible
|
||||
"timeout": 1000 * 60 * 20 // Timeout after 20 minutes
|
||||
});
|
||||
}
|
||||
if(params.has("token")) {
|
||||
socket_params.query = "token=" + params.get("token");
|
||||
}
|
||||
|
||||
this.socket = io.connect('', socket_params);
|
||||
|
||||
//Receive draw instructions from the server
|
||||
this.socket.on("broadcast", function (msg) {
|
||||
|
|
Loading…
Reference in a new issue