Add true repetition detection
[vchess.git] / public / javascripts / components / game.js
index c949c29..208e048 100644 (file)
@@ -20,7 +20,7 @@ Vue.component('my-game', {
                        hints: (getCookie("hints") === "1" ? true : false),
                        color: getCookie("color", "lichess"), //lichess, chesscom or chesstempo
                        // sound level: 0 = no sound, 1 = sound only on newgame, 2 = always
-                       sound: getCookie("sound", "2"),
+                       sound: parseInt(getCookie("sound", "2")),
                };
        },
        render(h) {
@@ -660,6 +660,7 @@ Vue.component('my-game', {
                                                                                                                "value": "0",
                                                                                                                innerHTML: "None"
                                                                                                        },
+                                                                                                       attrs: { "selected": this.sound==0 },
                                                                                                }
                                                                                        ),
                                                                                        h("option",
@@ -668,6 +669,7 @@ Vue.component('my-game', {
                                                                                                                "value": "1",
                                                                                                                innerHTML: "Newgame"
                                                                                                        },
+                                                                                                       attrs: { "selected": this.sound==1 },
                                                                                                }
                                                                                        ),
                                                                                        h("option",
@@ -676,6 +678,7 @@ Vue.component('my-game', {
                                                                                                                "value": "2",
                                                                                                                innerHTML: "All"
                                                                                                        },
+                                                                                                       attrs: { "selected": this.sound==2 },
                                                                                                }
                                                                                        ),
                                                                                ],