Rename method, fix useEffect dependencies

This commit is contained in:
Rob Watson 2022-01-15 12:14:27 +01:00
parent 41fe0ce2b1
commit bb3366ac9a
1 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ function App(): JSX.Element {
useEffect(() => {
document.addEventListener('keypress', handleKeyPress);
return () => document.removeEventListener('keypress', handleKeyPress);
}, [playState]);
}, [selection, playState]);
// load audio when MediaSet is loaded:
useEffect(() => {
@ -195,7 +195,7 @@ function App(): JSX.Element {
return;
}
handleTogglePlay();
togglePlay();
};
// handler called when the selection in the overview (zoom setting) is changed.
@ -229,7 +229,7 @@ function App(): JSX.Element {
video.currentTime = currentTime;
};
const handleTogglePlay = () => {
const togglePlay = () => {
if (playState == PlayState.Paused) {
play();
} else {
@ -417,7 +417,7 @@ function App(): JSX.Element {
</div>
<ControlBar
playState={playState}
onTogglePlay={handleTogglePlay}
onTogglePlay={togglePlay}
onClip={handleClip}
onZoomIn={handleZoomIn}
onZoomOut={handleZoomOut}