diff --git a/client/src/common/contexts/SettingsProvider.jsx b/client/src/common/contexts/SettingsProvider.jsx index fdd35be..ffa12b4 100644 --- a/client/src/common/contexts/SettingsProvider.jsx +++ b/client/src/common/contexts/SettingsProvider.jsx @@ -4,14 +4,24 @@ export const SettingsContext = createContext({}); export const SettingsProvider = ({children}) => { const [rounds, setRounds] = useState(localStorage.getItem("rounds") || 10); + const [demandTable, setDemandTable] = useState(JSON.parse(localStorage.getItem("demandTable")) || { + 0: 50, + 1800: 40, + 2200: 30 + }); const updateRounds = (newValue) => { localStorage.setItem("rounds", newValue); setRounds(newValue); } + const updateDemandTable = (newValue) => { + localStorage.setItem("demandTable", JSON.stringify(newValue)); + setDemandTable(newValue); + } + return ( - + {children} );