mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-16 15:58:00 +00:00
test
This commit is contained in:
@@ -6,10 +6,8 @@ import {
|
||||
} from '../Contexts/GlobalSettingsContext';
|
||||
import { useAnalytics } from '../Hooks/useAnalytics';
|
||||
import {
|
||||
GameFormat,
|
||||
InitialGameSettings,
|
||||
InitialGameSettingsSchema,
|
||||
Orientation,
|
||||
Settings,
|
||||
} from '../Types/Settings';
|
||||
|
||||
@@ -28,22 +26,11 @@ export const GlobalSettingsProvider = ({
|
||||
savedShowPlay ? savedShowPlay === 'true' : false
|
||||
);
|
||||
|
||||
const [initialGameSettings, setInitialSettings] =
|
||||
const [initialGameSettings, setInitialGameSettings] =
|
||||
useState<InitialGameSettings | null>(
|
||||
savedGameSettings ? JSON.parse(savedGameSettings) : null
|
||||
);
|
||||
|
||||
const setInitialGameSettings = (initialGameSettings: InitialGameSettings) => {
|
||||
const defaultSettings: InitialGameSettings = {
|
||||
numberOfPlayers: 4,
|
||||
startingLifeTotal: 40,
|
||||
useCommanderDamage: true,
|
||||
orientation: Orientation.Landscape,
|
||||
gameFormat: GameFormat.Commander,
|
||||
};
|
||||
setInitialSettings({ ...defaultSettings, ...initialGameSettings });
|
||||
};
|
||||
|
||||
const [settings, setSettings] = useState<Settings>(
|
||||
savedSettings
|
||||
? JSON.parse(savedSettings)
|
||||
|
||||
Reference in New Issue
Block a user