From 35354b0c93f68602c33ef775feefc28f483a6f9e Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Fri, 13 Mar 2020 02:02:23 -0500 Subject: [PATCH] partial fix for current game not appearing in drop-down list --- js/chess.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/js/chess.js b/js/chess.js index 323b052..e85e6ce 100644 --- a/js/chess.js +++ b/js/chess.js @@ -721,6 +721,13 @@ $(function (){ $('#cb_light_name').on('input', updateMeta); $('#cb_dark_name').on('input', updateMeta); + var gameId = location.hash.replace(/^#\//, ''); + if (gameId.length !== 16) { + gameId = randomId(); + } + + switchGameId(gameId); + function updateTitle(opt){ opt = $(opt); @@ -807,14 +814,6 @@ $(function (){ switchGameId(gameId); } }; - - - var gameId = location.hash.replace(/^#\//, ''); - if (gameId.length !== 16) { - gameId = randomId(); - } - - switchGameId(gameId); }); /* vim:set expandtab sw=3 ts=8: */