X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fstore.js;h=f95e488fd52a7029b1373aa22c8ce3bd35bb4e7d;hp=a999b0ac989a1028419f619a3e2f065a56331f75;hb=66d03f23c9ce085877c3f7272db44dc382762b5a;hpb=a9b131f10ee55bd96c60180c55666df4b1f4dc4d diff --git a/client/src/store.js b/client/src/store.js index a999b0ac..f95e488f 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -39,7 +39,7 @@ export const store = this.state.user.notify = res.notify; }); } - this.state.conn = new WebSocket(params.socketUrl + "/?sid=" + this.state.user.sid); + this.state.conn = new WebSocket(params.socketUrl + "/?sid=" + mysid); // Settings initialized with values from localStorage this.state.settings = { bcolor: localStorage["bcolor"] || "lichess", @@ -50,6 +50,7 @@ export const store = sqSize: parseInt(localStorage["sqSize"]), }; this.socketCloseListener = () => { + // Next line may fail at first, but should retry and eventually success (TODO?) this.state.conn = new WebSocket(params.socketUrl + "/?sid=" + mysid); }; this.state.conn.onclose = this.socketCloseListener;