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) {
|
||||
setAnnotations(prevAnnotations => {
|
||||
const newAnnotations = {
|
||||
...prevAnnotations,
|
||||
[currentTime]: { time: currentTime, annotations: detections, imageData }
|
||||
};
|
||||
const newAnnotations = {
|
||||
...annotations,
|
||||
[currentTime]: { time: currentTime, annotations: detections, imageData }
|
||||
};
|
||||
|
||||
saveAnnotation(currentTime, detections, imageData);
|
||||
setErrorMessage("");
|
||||
setAnnotations(newAnnotations);
|
||||
|
||||
return newAnnotations;
|
||||
});
|
||||
saveAnnotation(currentTime, detections, imageData);
|
||||
setErrorMessage("");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -132,7 +130,7 @@ function AnnotationMain() {
|
||||
};
|
||||
|
||||
const handleStop = () => {
|
||||
setIsPlaying(prev => !prev);
|
||||
setIsPlaying(false);
|
||||
setCurrentTime(0);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user