store initial state as soon as a new game is created
This commit is contained in:
parent
e1722cf589
commit
fe711991f5
|
|
@ -792,6 +792,7 @@ $(function (){
|
|||
let optIndex = $('#cb_select_game')[0].selectedIndex;
|
||||
if (optIndex === 0) {
|
||||
switchGameId(randomId());
|
||||
putState();
|
||||
} else if (optIndex >= 1) {
|
||||
let opt = $('#cb_select_game option')[optIndex];
|
||||
if (opt) {
|
||||
|
|
@ -946,7 +947,12 @@ $(function (){
|
|||
window.setTimeout(function(){ location.reload(); }, 4*3600*1000);
|
||||
|
||||
const foundId = location.hash.match(/^#\/([0-9a-f]{16}\b)/);
|
||||
switchGameId(foundId ? foundId[1] : randomId());
|
||||
if (foundId) {
|
||||
switchGameId(foundId[1]);
|
||||
} else {
|
||||
switchGameId(randomId());
|
||||
putState();
|
||||
}
|
||||
|
||||
/* Low-level commands to be run from the JS console */
|
||||
window.Admin = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue