Skip to content

Commit

Permalink
Fix case where multiple previews play at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Mar 19, 2024
1 parent 0914514 commit 4e668f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion web/src/views/events/EventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ function DetectionReview({

const [previewTime, setPreviewTime] = useState<number>();

const onPreviewTimeUpdate = useCallback(
(time: number) => {
if (!previewTime || time > previewTime) {
setPreviewTime(time);
}
},
[previewTime, setPreviewTime],
);

// review interaction

const [hasUpdate, setHasUpdate] = useState(false);
Expand Down Expand Up @@ -483,7 +492,7 @@ function DetectionReview({
allPreviews={relevantPreviews}
setReviewed={markItemAsReviewed}
scrollLock={scrollLock}
onTimeUpdate={setPreviewTime}
onTimeUpdate={onPreviewTimeUpdate}
onClick={onSelectReview}
/>
</div>
Expand Down

0 comments on commit 4e668f0

Please sign in to comment.