From bb3366ac9a6755d0434fc27ffb729aa760092293 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sat, 15 Jan 2022 12:14:27 +0100 Subject: [PATCH] Rename method, fix useEffect dependencies --- frontend/src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9f90c50..6afe307 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -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 {