Skip to content

Commit

Permalink
Fix video annotation promise bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Feb 13, 2025
1 parent 0726cbf commit 453736a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion resources/assets/js/core/messages/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ class Store {

let store = new Store();

export let handleErrorResponse = store.handleErrorResponse;
export let handleErrorResponse = store.handleErrorResponse.bind(store);

export default store;
15 changes: 9 additions & 6 deletions resources/assets/js/videos/models/Annotation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ export default class Annotation {
}
attachAnnotationLabel(label) {
return VideoAnnotationApi.attachLabel({id: this.id}, {label_id: label.id})
.then(this.handleAttachedLabel);
return VideoAnnotationApi
.attachLabel({id: this.id}, {label_id: label.id})
.then(this.handleAttachedLabel.bind(this));
}
handleAttachedLabel(response) {
Expand Down Expand Up @@ -333,8 +334,9 @@ export default class Annotation {
}
split(time) {
return VideoAnnotationApi.split({id: this.id}, {time: time})
.then(this.handleFinishedSplit);
return VideoAnnotationApi
.split({id: this.id}, {time: time})
.then(this.handleFinishedSplit.bind(this));
}
handleFinishedSplit(response) {
Expand All @@ -346,8 +348,9 @@ export default class Annotation {
}
link(other) {
return VideoAnnotationApi.link({id: this.id}, {annotation_id: other.id})
.then(this.handleFinishedLink);
return VideoAnnotationApi
.link({id: this.id}, {annotation_id: other.id})
.then(this.handleFinishedLink.bind(this));
}
handleFinishedLink(response) {
Expand Down

0 comments on commit 453736a

Please sign in to comment.