diff --git a/client/src/App.js b/client/src/App.js index 5afa60f..a93fbae 100755 --- a/client/src/App.js +++ b/client/src/App.js @@ -84,7 +84,9 @@ const Table = () => { const [winnerDismissed, setWinnerDismissed] = useState(undefined); const [global, setGlobal] = useState({}); const [count, setCount] = useState(0); - const [volume, setVolume] = useState(0.5); + const [volume, setVolume] = useState( + localStorage.getItem('volume') ? + parseFloat(localStorage.getItem('volume')) : 0.5); const fields = [ 'id', 'state', 'color', 'name', 'private', 'dice', 'turn' ]; const onWsOpen = (event) => { @@ -483,6 +485,7 @@ const Table = () => { min="0" max="100" onInput={(e) => { const alpha = e.currentTarget.value / 100; + localStorage.setItem('volume', alpha); setVolume(alpha); }}/> }