Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove null (gap) to prevent validation errors #728

Merged
merged 8 commits into from
Jan 19, 2024
11 changes: 11 additions & 0 deletions resources/assets/js/videos/models/Annotation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,17 @@ export default Vue.extend({
this.frames.splice(index, 1);
this.points.splice(index, 1);

// Remove null (gap filler) as first/last element to prevent validation errors
if (this.frames[0] === null) {
this.frames.shift();
this.points.shift();
}

if (this.frames.at(-1) === null) {
this.frames.pop();
this.points.pop();
}

return VideoAnnotationApi.update({id: this.id}, {
frames: this.frames,
points: this.points
Expand Down