X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;fp=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=79f089e1f3bcaf07eaee1b0ed50590d551b5cc96;hp=cd31e70a908ab4f73945987e8adee39af2c10106;hb=00eef1ca12534a43cb8e2e12155a46c00353eac2;hpb=15d6904394c63102e7865b5537eb3b533e3ac06f diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index cd31e70a..79f089e1 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -121,13 +121,15 @@ export default { // TODO: is it OK to pass "computed" as properties? // Also, some are seemingly not recomputed when vr is initialized. showMoves: function() { - return this.game.score != "*" - ? "all" - : (!!this.vr ? this.vr.showMoves : "none"); + return ( + !!this.game.score && this.game.score != "*" + ? "all" + : (!!this.vr ? this.vr.showMoves : "none") + ); }, showTurn: function() { return ( - this.game.score == '*' && + !!this.game.score && this.game.score == '*' && !!this.vr && ( this.vr.showMoves != "all" || @@ -138,7 +140,7 @@ export default { }, canAnalyze: function() { return ( - this.game.mode != "analyze" && + !!this.game.mode && this.game.mode != "analyze" && !!this.vr && this.vr.canAnalyze ); }, @@ -147,8 +149,8 @@ export default { }, allowDownloadPGN: function() { return ( - this.game.score != "*" || - (!!this.vr && this.vr.showMoves == "all") + (!!this.game.score && this.game.score != "*") || + (!!this.vr && !this.vr.someHiddenMoves) ); } },