diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-10-21 18:26:12 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-10-21 18:26:12 +0200 |
| commit | b546f2b6d9b6f9fde486ddc99e90ceaaa93cccff (patch) | |
| tree | 1526ff5b3c4756a660b4122f717b2d51a7df492b /animism-align/frontend/app/utils | |
| parent | 3f76b12c0f822d2d47dfbdd745f80ee803d95d98 (diff) | |
handle actual ts of note
Diffstat (limited to 'animism-align/frontend/app/utils')
| -rw-r--r-- | animism-align/frontend/app/utils/transcript.utils.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/animism-align/frontend/app/utils/transcript.utils.js b/animism-align/frontend/app/utils/transcript.utils.js index a8f889c..445a255 100644 --- a/animism-align/frontend/app/utils/transcript.utils.js +++ b/animism-align/frontend/app/utils/transcript.utils.js @@ -5,6 +5,7 @@ import { INLINE_UTILITY_ANNOTATION_TYPES, FULLSCREEN_UTILITY_ANNOTATION_TYPES, } from 'app/constants' +import { timestampToSeconds } from 'app/utils' export const buildParagraphs = (annotationOrder, sectionCount, footnoteCount) => { const state = store.getState() @@ -95,7 +96,9 @@ export const buildParagraphs = (annotationOrder, sectionCount, footnoteCount) => annotation.footnote_id = footnoteCount } // set annotation start point to the start of the previous sentence - if (currentParagraph.annotations[currentParagraph.annotations.length - 1]) { + if (annotation.settings.actual_ts) { + annotation.start_ts = timestampToSeconds(annotation.settings.actual_ts) + } else if (currentParagraph.annotations[currentParagraph.annotations.length - 1]) { annotation.start_ts = currentParagraph.annotations[currentParagraph.annotations.length - 1].start_ts } footnotes.push(annotation) |
