Skip to content

Commit

Permalink
fix leadermode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cmavelis committed Aug 13, 2023
1 parent d472302 commit 52bc65f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Game extends React.Component {

seedNewGame = () => {
let { randomSeed } = this.props;
const { wordFile } = this.props;
const { wordFile, toggleLeaderMode } = this.props;
const { wordList, listLength } = wordFile;
const today = new Date();
const todayValue = today.getUTCFullYear().toString()
Expand Down Expand Up @@ -117,6 +117,7 @@ class Game extends React.Component {
// apply random seed before shuffling the Array
Math.seedrandom(randomSeed);
const newCardColors = _.shuffle(fullArray);
toggleLeaderMode(false);
this.setState({
cardColors: newCardColors,
words: wordsSelected,
Expand Down Expand Up @@ -229,6 +230,7 @@ Game.propTypes = {
wordFile: PropTypes.objectOf(PropTypes.any).isRequired,
randomSeed: PropTypes.string.isRequired,
leaderMode: PropTypes.bool.isRequired,
toggleLeaderMode: PropTypes.func.isRequired,
};

export default Game;
1 change: 1 addition & 0 deletions src/GameLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class GameLoader extends React.Component {
wordFile={wordFiles.cardsClassic}
generateNewSeed={this.generateNewSeed}
leaderMode={leaderMode}
toggleLeaderMode={this.toggleLeaderMode}
/>
</div>
)
Expand Down

0 comments on commit 52bc65f

Please sign in to comment.