- this.state.settings = {
- 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"]),
+ const getItemDefaultTrue = (item) => {
+ const value = localStorage.getItem(item);
+ if (!value) return true;
+ return value == "true";