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: */