Remove conditional spreading

This commit is contained in:
James Deacon 2022-01-17 19:58:02 +00:00
parent 12a741db39
commit a0c45d9da4

View file

@ -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) {