diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index 3b6fbdd..167da97 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -6,7 +6,7 @@ import { TEXT_ANNOTATION_TYPES, INLINE_UTILITY_ANNOTATION_TYPES, FULLSCREEN_UTILITY_ANNOTATION_TYPES, - CURTAIN_COLOR_LOOKUP, + CURTAIN_COLOR_LOOKUP, GROWL, } from 'app/constants' import { floatInRange } from 'app/utils' import { buildParagraphs } from 'app/utils/transcript.utils' @@ -18,6 +18,7 @@ const newSection = (annotation, index, mediaIndex) => ({ end_ts: 0, title: annotation.text, media: [], + fullscreenTimeline: [], index, mediaIndex, no_audio: !!annotation.settings.no_audio, @@ -46,7 +47,7 @@ export const loadSections = () => dispatch => { // keep track of all annotations that constitute fullscreen events. // these include curtains, title cards, and fullscreen media. - let fullscreenTimeline = [] + // let fullscreenTimeline = [] // fetch all annotations and media const state = store.getState() @@ -116,7 +117,7 @@ export const loadSections = () => dispatch => { // build timeline of fullscreen events if (FULLSCREEN_UTILITY_ANNOTATION_TYPES.has(annotation.type) || annotation.settings.fullscreen) { const event = makeFullscreenEvent(eventIndex++, annotation) - fullscreenTimeline.push(event) + currentSection.fullscreenTimeline.push(event) } // add text annotations to section annotation order @@ -143,7 +144,7 @@ export const loadSections = () => dispatch => { // console.log(sections) // console.log(fullscreenTimeline) - dispatch({ type: types.viewer.load_sections, sections, fullscreenTimeline }) + dispatch({ type: types.viewer.load_sections, sections }) } const makeFullscreenEvent = (index, annotation) => { @@ -177,9 +178,12 @@ export const toggleComponent = key => dispatch => { dispatch({ type: types.viewer.toggle_component, key, value: !store.getState().viewer[key] }) } -export const reachedEndOfSection = () => dispatch => { +export const reachedEndOfSection = currentSection => dispatch => { actions.audio.pause() dispatch({ type: types.viewer.reached_end_of_section }) + if (currentSection && currentSection.index === 0) { + actions.viewer.openGrowl(GROWL.REACHED_END_OF_FIRST_SECTION) + } } export const setCurrentSection = (currentSection, nextSection) => dispatch => { |
