Skip to content

Commit 8c5c7a7

Browse files
committed
Fix video annotation attach label error handling
1 parent f71be43 commit 8c5c7a7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

resources/assets/js/videos/videoContainer.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,18 +449,19 @@ export default {
449449
}
450450
},
451451
attachAnnotationLabel(annotation) {
452-
let promise = annotation.attachAnnotationLabel(this.selectedLabel);
453-
promise.catch(handleErrorResponse);
454-
455-
return promise;
452+
annotation
453+
.attachAnnotationLabel(this.selectedLabel)
454+
.catch(handleErrorResponse);
456455
},
457456
swapAnnotationLabel(annotation) {
458457
let lastLabel = annotation.labels
459458
.filter(l => l.user_id === this.user.id)
460459
.sort((a, b) => a.id - b.id)
461460
.pop();
462461
463-
this.attachAnnotationLabel(annotation)
462+
// Can't use attachAnnotationLabel() because detachAnnotationLabel() should
463+
// not be called on error.
464+
annotation.attachAnnotationLabel(this.selectedLabel)
464465
.then(() => {
465466
if (lastLabel) {
466467
this.detachAnnotationLabel(annotation, lastLabel);

0 commit comments

Comments
 (0)