Skip to content

Commit

Permalink
fix: setting defaultState properly even when query is being parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Mar 29, 2024
1 parent 54281d1 commit 4262341
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
duration_short: true,
duration_long: true,
};
var defaultState = state;
var N;
var myGameInstance;

Expand Down Expand Up @@ -480,6 +481,7 @@
}

function readState(inputStr) {

decodeJSONState(inputStr);

updateStateDefaults();
Expand Down Expand Up @@ -533,7 +535,6 @@
function decodeJSONState(stateBase64) {
var decodedStateJson = atob(stateBase64); // Decode base64 to JSON

var defaultState = state;
state = JSON.parse(decodedStateJson);
}

Expand Down

0 comments on commit 4262341

Please sign in to comment.