diff --git a/src/annotationForm/AnnotationFormFooter.js b/src/annotationForm/AnnotationFormFooter.js index 656786e969e795235b53da9ce74ba072a54c07e0..a14e76f1ad92c8d76b55b2e3d526b8379ddcd2f8 100644 --- a/src/annotationForm/AnnotationFormFooter.js +++ b/src/annotationForm/AnnotationFormFooter.js @@ -85,15 +85,23 @@ function AnnotationFormFooter({ const isNewAnnotation = !annotation; - // Save jpg image of the drawing in a data url - getKonvaAsDataURL(windowId).then((dataURL) => { - console.log('dataURL:', dataURL); + // TODO dumb code to avoid error from Konva export. WIth image, Konva doesnot work + if (mediaIsVideo) { + // Save jpg image of the drawing in a data url + getKonvaAsDataURL(windowId).then((dataURL) => { + console.log('dataURL:', dataURL); + const annotation = { ...annotationToSaved }; + annotation.body.id = dataURL; + saveAnnotationInEachCanvas(canvases, config, receiveAnnotation, annotation, target, isNewAnnotation); + closeFormCompanionWindow(); + resetStateAfterSave(); + }); + } else { const annotation = { ...annotationToSaved }; - annotation.body.id = dataURL; saveAnnotationInEachCanvas(canvases, config, receiveAnnotation, annotation, target, isNewAnnotation); closeFormCompanionWindow(); resetStateAfterSave(); - }); + } }; return (