mirror of
https://github.com/azaion/ui.git
synced 2026-04-23 03:26:36 +00:00
fix double annotation save
This commit is contained in:
@@ -75,17 +75,15 @@ function AnnotationMain() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (imageData) {
|
if (imageData) {
|
||||||
setAnnotations(prevAnnotations => {
|
|
||||||
const newAnnotations = {
|
const newAnnotations = {
|
||||||
...prevAnnotations,
|
...annotations,
|
||||||
[currentTime]: { time: currentTime, annotations: detections, imageData }
|
[currentTime]: { time: currentTime, annotations: detections, imageData }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setAnnotations(newAnnotations);
|
||||||
|
|
||||||
saveAnnotation(currentTime, detections, imageData);
|
saveAnnotation(currentTime, detections, imageData);
|
||||||
setErrorMessage("");
|
setErrorMessage("");
|
||||||
|
|
||||||
return newAnnotations;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -132,7 +130,7 @@ function AnnotationMain() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleStop = () => {
|
const handleStop = () => {
|
||||||
setIsPlaying(prev => !prev);
|
setIsPlaying(false);
|
||||||
setCurrentTime(0);
|
setCurrentTime(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user