mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-16 15:58:00 +00:00
fix small stuff
This commit is contained in:
@@ -7,10 +7,6 @@
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@mui/material": "^5.13.6",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^13.0.0",
|
||||
"@testing-library/user-event": "^13.2.1",
|
||||
"@types/jest": "^27.0.1",
|
||||
"@types/node": "^16.7.13",
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
@@ -20,7 +16,6 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"react-screen-wake-lock": "^3.0.1",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-swipeable": "^7.0.1",
|
||||
"styled-components": "^6.0.1",
|
||||
"typescript": "^4.4.2",
|
||||
"web-vitals": "^2.1.0"
|
||||
|
||||
12
src/App.tsx
12
src/App.tsx
@@ -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 />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export type Player = {
|
||||
lifeTotal: number;
|
||||
key?: number; // Deprecated, use index instead
|
||||
index: number;
|
||||
color: string;
|
||||
settings: PlayerSettings;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
Reference in New Issue
Block a user