- const url = window.location.href;
- const hashPos = url.indexOf("#");
- console.log(hashPos + " " + url);
- if (hashPos >= 0)
- this.setDisplay(url.substr(hashPos+1));
+ // TODO: navigation becomes a little more complex
+ this.setDisplay();
+ window.onhashchange = this.setDisplay;
+
+ this.myid = "abcdefghij";
+//console.log(this.myid + " " + variant);
+ //myid: localStorage.getItem("myid"), //our ID, always set
+
+ this.conn = new WebSocket(socketUrl + "/?sid=" + this.myid + "&page=" + variant.id);
+ const socketCloseListener = () => {
+ this.conn = new WebSocket(socketUrl + "/?sid=" + this.myid + "&page=" + variant.id);
+ }
+ this.conn.onclose = socketCloseListener;
+
+ //this.vr = new VariantRules( V.GenRandInitFen() );