Some fixes
[vchess.git] / client / src / store.js
index 3b280d9..1cfb7c5 100644 (file)
@@ -36,8 +36,8 @@ export const store =
         this.state.user.notify = res.notify;
       });
     }
-    this.state.conn = new WebSocket(
-      params.socketUrl + "/?sid=" + mysid + "&page=" + page);
+    this.state.conn = new WebSocket(params.socketUrl + "/?sid=" + mysid +
+      "&page=" + encodeURIComponent(page));
     // Settings initialized with values from localStorage
     this.state.settings = {
       bcolor: localStorage["bcolor"] || "lichess",
@@ -49,7 +49,8 @@ export const store =
     };
     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 = new WebSocket(params.socketUrl + "/?sid=" + mysid +
+        "&page=" + encodeURIComponent(page));
     };
     this.state.conn.onclose = this.socketCloseListener;
     const supportedLangs = ["en","es","fr"];