From 07cfcc049e8d7bf437b732808397d7b41be9f841 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 21 Oct 2020 18:01:13 +0200 Subject: adding the footnotes.. --- animism-align/frontend/app/utils/transcript.utils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'animism-align/frontend/app/utils') diff --git a/animism-align/frontend/app/utils/transcript.utils.js b/animism-align/frontend/app/utils/transcript.utils.js index 2a089a0..a8f889c 100644 --- a/animism-align/frontend/app/utils/transcript.utils.js +++ b/animism-align/frontend/app/utils/transcript.utils.js @@ -91,9 +91,13 @@ export const buildParagraphs = (annotationOrder, sectionCount, footnoteCount) => if (annotation.type === 'footnote') { // bump footnote count and attach it to this annotation, so we can find it later footnoteCount += 1 - annotation.footnote_id = footnoteCount + if (!annotation.footnote_id || annotation.footnote_id === 1) { + annotation.footnote_id = footnoteCount + } // set annotation start point to the start of the previous sentence - annotation.start_ts = currentParagraph.annotations[currentParagraph.annotations.length - 1].start_ts + if (currentParagraph.annotations[currentParagraph.annotations.length - 1]) { + annotation.start_ts = currentParagraph.annotations[currentParagraph.annotations.length - 1].start_ts + } footnotes.push(annotation) } -- cgit v1.2.3-70-g09d2