Skip to content

Commit

Permalink
feat: Render annotations on items change. #1601
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Aug 10, 2023
1 parent 1bef657 commit 4c9d3c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui/src/parts/range_annotator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,12 @@ export const
return withinBounds ? (trackPosPx - zoom.from) / (zoom.to - zoom.from) : null
}

React.useEffect(() => {
const annotations = itemsToAnnotations(items)
annotations.sort((a, b) => a.start - b.start)
setAnnotations(recalculateAnnotations(annotations))
}, [items])

React.useEffect(() => {
setAnnotations(annotations => annotations.map(a => {
if (a.isFocused) {
Expand Down

0 comments on commit 4c9d3c3

Please sign in to comment.