Skip to content

Commit d3dcd27

Browse files
Merge pull request #21 from MadinventorZero/annofix
Fix for annotations
2 parents cd13e96 + 45dbd82 commit d3dcd27

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/src/components/main/Annotation.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,22 @@ function Annotation({
7070
return handleFindAnno(array[i], id);
7171
}
7272
}
73+
return '';
7374
}
7475

7576
/**
7677
* This useEffect allows the annotations to remain persistent when changing between root level components on the right panel
7778
*/
7879
useEffect(() => {
79-
const event = {
80-
target : { value: handleFindAnno(childrenArray, id).annotations},
81-
id : id,
80+
const targetElement = handleFindAnno(childrenArray, id);
81+
if (targetElement !== '') {
82+
const event = {
83+
target : { value: targetElement.annotations},
84+
id : id,
85+
}
86+
console.log("is this a value?", event.target.value);
87+
handleAnnoChange(event);
8288
}
83-
84-
handleAnnoChange(event);
8589
}, [state.canvasFocus])
8690

8791
const body = (

0 commit comments

Comments
 (0)