Skip to content

Commit

Permalink
lint: Fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Dec 19, 2023
1 parent 556a567 commit 56c2f11
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions frontend/src/components/Playback/Playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,25 @@ const Playback = ({
finishedPlaying();
}
}, []);

// Keep track of last player index
useEffect(() => {
lastPlayerIndex.current = playerIndex;
}, [playerIndex]);

if (playConfig.play_method === 'EXTERNAL') {
webAudio.closeWebAudio();
if (playConfig.play_method === 'EXTERNAL') {
webAudio.closeWebAudio();
}

// Play section with given index
const playSection = useCallback(
(index = 0) => {

if (index !== lastPlayerIndex.current) {
// Load different audio
if (prevPlayerIndex.current !== -1) {
pauseAudio(playConfig);
}
}
// Store player index
setPlayerIndex(index);

Expand All @@ -115,7 +115,7 @@ const Playback = ({
activeAudioEndedListener.current = webAudio.listenOnce("ended", onAudioEnded);
} else {
activeAudioEndedListener.current = audio.listenOnce("ended", onAudioEnded);
}
}

// Compensate for audio latency and set state to playing
setTimeout(startedPlaying && startedPlaying(), latency);
Expand All @@ -124,7 +124,7 @@ const Playback = ({

// Stop playback
if (lastPlayerIndex.current === index) {
pauseAudio(playConfig);
pauseAudio(playConfig);
setPlayerIndex(-1);
return;
}
Expand Down Expand Up @@ -183,10 +183,10 @@ const Playback = ({
return (
<Preload
instruction={preloadMessage}
duration={playConfig.ready_time}
duration={playConfig.ready_time}
sections={sections}
playConfig={playConfig}
onNext={() => {
onNext={() => {
setView(playerType);
onPreloadReady();
}}
Expand Down Expand Up @@ -227,7 +227,7 @@ const Playback = ({
return <div> Unknown player view {view} </div>;
}
};

return (
<div className="aha__playback">
<div className="playback"> {render(playerType)} </div>{" "}
Expand Down

0 comments on commit 56c2f11

Please sign in to comment.