MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / handleVolumeChange

Function handleVolumeChange

client/src/components/settings/sound.tsx:25–39  ·  view source on GitHub ↗
(event: ChangeEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

23 const [mayPlay, setMayPlay] = useState(true);
24
25 function handleVolumeChange(event: ChangeEvent<HTMLInputElement>) {
26 const inputValue = Number(event.target.value);
27
28 store.set('soundVolume', inputValue);
29
30 setVolumeDisplay((store.get('soundVolume') as number) ?? 50);
31
32 if (mayPlay) {
33 void playTone('tests-completed');
34 setMayPlay(false);
35 setTimeout(() => {
36 setMayPlay(true);
37 }, 200);
38 }
39 }
40
41 return (
42 <>

Callers

nothing calls this directly

Calls 1

playToneFunction · 0.90

Tested by

no test coverage detected