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