Prevent state corruption by removing cameraStream from localStorage
This commit is contained in:
parent
82cae002f8
commit
9b427d2df8
1 changed files with 5 additions and 1 deletions
|
|
@ -27,7 +27,11 @@ const useGameState = () => {
|
|||
});
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('tschausepp_game_state', JSON.stringify(gameState));
|
||||
const stateToSave = {
|
||||
...gameState,
|
||||
cameraStream: null,
|
||||
};
|
||||
localStorage.setItem('tschausepp_game_state', JSON.stringify(stateToSave));
|
||||
}, [gameState]);
|
||||
|
||||
const updatePlayers = (players: Player[]) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue