Skip to content

Commit

Permalink
fix bug where init tries to read value from null saved state
Browse files Browse the repository at this point in the history
  • Loading branch information
skedwards88 committed Jan 28, 2025
1 parent 73a2d01 commit f2b4da4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ PWA_Builder
.env
.env.test
.vscode/
.DS_Store
2 changes: 1 addition & 1 deletion src/logic/gameInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function gameInit({
let minLetters = isDaily
? getNumLettersForDay()
: Math.min(Math.max(numLetters, 20), 60) ||
Math.min(Math.max(savedState.numLetters, 20), 60) ||
Math.min(Math.max(savedState?.numLetters, 20), 60) ||
30; // Custom puzzles can exceed the min/max letters used for a randomly generated game. Constrain minLetters in this cases so that future randomly generated games don't use these extreme values.
let gridSize = getGridSizeForLetters(minLetters);

Expand Down

0 comments on commit f2b4da4

Please sign in to comment.