Skip to content
Snippets Groups Projects
Verified Commit de1696d2 authored by Loïs Poujade's avatar Loïs Poujade
Browse files

edition: select correct annotation

When multiples annotations sources/list are presents, selected
annotation was overwrite with undefined (cause it was not found in
following annotations lists)
parent 7af2d10f
Branches
Tags
1 merge request!4Add / edit annotation on video
......@@ -18,12 +18,13 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
const { annotationid } = getCompanionWindow(state, { companionWindowId, windowId });
const canvases = getVisibleCanvases(state, { windowId });
let annotation;
let annotation = null;
canvases.forEach((canvas) => {
const annotationsOnCanvas = state.annotations[canvas.id];
Object.values(annotationsOnCanvas || {}).forEach((value, i) => {
if (value.json && value.json.items) {
annotation = value.json.items.find((anno) => anno.id === annotationid);
const maybeAnnot = value.json.items.find((anno) => anno.id === annotationid);
if (maybeAnnot !== undefined) annotation = maybeAnnot;
}
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment