- bcolor: localStorage["bcolor"] || "lichess",
- sound: parseInt(localStorage["sound"]) || 2,
- hints: parseInt(localStorage["hints"]) || 1,
- coords: !!eval(localStorage["coords"]),
- highlight: !!eval(localStorage["highlight"]),
- 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 +
- "&page=" + encodeURIComponent(page));
+ bcolor: localStorage.getItem("bcolor") || "lichess",
+ sound: parseInt(localStorage.getItem("sound")) || 1,
+ hints: localStorage.getItem("hints") == "true",
+ highlight: localStorage.getItem("highlight") == "true"