fix small stuff

This commit is contained in:
Viktor Rådberg
2023-08-02 16:11:39 +02:00
parent dc8985e88c
commit c43a2dfe98
5 changed files with 652 additions and 588 deletions

View File

@@ -77,7 +77,19 @@ const App = () => {
setPlayers([...players]); // ensure to trigger a re-render
};
const newGame = () => {
localStorage.removeItem('players');
localStorage.removeItem('initialGameSettings');
window.location.reload();
};
if (players.length > 0 && initialGameSettings) {
// If the user has a key, we need to restart since key is deprecated
// FIXME: Remove this after a few months
if (players[0].key) {
newGame();
}
return (
<ThemeProvider theme={theme}>
<GlobalStyles />