We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2dfc51a commit dbf3b06Copy full SHA for dbf3b06
src/modules/game/model/state.ts
@@ -33,7 +33,15 @@ export const useGameState = create(
33
isFinished: false,
34
35
startGame: async (playerCount: number, cardMatrixSize: number) => {
36
- set({ areCardsLoading: true })
+ set(
37
+ produce((state: GameState) => {
38
+ state.isFinished = false
39
+ state.areCardsLoading = true
40
+ state.turn.playerIndex = 0
41
+ state.turn.selectedCards = []
42
+ state.turn.isFinished = false
43
+ }),
44
+ )
45
46
// TODO: add settings to choose an api for images
47
const gameService = new GameService(
0 commit comments