Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not call onNext() from within map #1003

Merged
merged 4 commits into from
May 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions frontend/src/components/Preload/Preload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ const Preload = ({ sections, playMethod, duration, preloadMessage, pageTitle, on
}

if (playMethod === 'BUFFER') {

// Use Web-audio and preload sections in buffers
sections.map((section, index) => {
// skip Preload if the section has already been loaded in the previous action
if (webAudio.checkSectionLoaded(section)) {
onNext();
return undefined;
return true;
}
// Clear buffers if this is the first section
if (index === 0) {
Expand All @@ -57,6 +55,7 @@ const Preload = ({ sections, playMethod, duration, preloadMessage, pageTitle, on
}
});
})
onNext();
} else {
if (playMethod === 'EXTERNAL') {
webAudio.closeWebAudio();
Expand Down
Loading