Skip to content
Snippets Groups Projects
Commit 584dd408 authored by joni's avatar joni
Browse files

Don't have two removes in sticky-object

parent 89b3bd2c
No related branches found
No related tags found
No related merge requests found
...@@ -33,10 +33,6 @@ AFRAME.registerComponent("sticky-object", { ...@@ -33,10 +33,6 @@ AFRAME.registerComponent("sticky-object", {
this.el.removeEventListener("grab-end", this._onRelease); this.el.removeEventListener("grab-end", this._onRelease);
}, },
remove() {
this.el.removeEventListener("body-loaded", this._onBodyLoaded);
},
setLocked(locked) { setLocked(locked) {
if (this.el.components.networked && !NAF.utils.isMine(this.el)) return; if (this.el.components.networked && !NAF.utils.isMine(this.el)) return;
...@@ -64,6 +60,7 @@ AFRAME.registerComponent("sticky-object", { ...@@ -64,6 +60,7 @@ AFRAME.registerComponent("sticky-object", {
}, },
remove() { remove() {
this.el.removeEventListener("body-loaded", this._onBodyLoaded);
if (this.stuckTo) { if (this.stuckTo) {
const stuckTo = this.stuckTo; const stuckTo = this.stuckTo;
delete this.stuckTo; delete this.stuckTo;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment