summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js
index 4389f51..a29383b 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -159,8 +159,12 @@ export const loadSections = () => dispatch => {
// last fixes on the sections
sections.forEach((currentSection, i) => {
// set the end_ts for each section (i.e. just before the next section starts)
- if (currentSection.end_ts === 0 && i < sections.length - 1) {
- currentSection.end_ts = sections[i+1].start_ts - 1
+ if (i < sections.length - 1) {
+ // if the section doesnt have an end_ts (how??) then set it to end right before the next one.
+ // also if the end_ts is beyond the beginning of the next section (more possible...)
+ if (currentSection.end_ts === 0 || currentSection.end_ts > sections[i+1].start_ts - 1) {
+ currentSection.end_ts = sections[i+1].start_ts - 1
+ }
}
// if the first fullscreen event is close to the beginning of the section, move it there
time_to_first_fullscreen_element = 0