Skip to content
Snippets Groups Projects
Commit 69468a04 authored by joni's avatar joni
Browse files

Remove timeout

parent 23151d87
No related branches found
No related tags found
No related merge requests found
......@@ -18,16 +18,15 @@ AFRAME.registerComponent("hand-pose-state", {
},
init() {
this.setSelfAsStore = this.setSelfAsStore.bind(this);
this.setSelfAsStore();
},
setSelfAsStore() {
let poseEl = this.el.querySelector(`[hand-pose__${this.id}]`);
if (!poseEl) {
window.setTimeout(() => {
this.setSelfAsStore();
}, 3000);
return;
}
play() {
this.el.addEventListener("model-loaded", this.setSelfAsStore);
},
pause() {
this.el.removeEventListener("model-loaded", this.setSelfAsStore);
},
setSelfAsStore(e) {
let poseEl = e.target.querySelector(`[hand-pose__${this.id}]`);
poseEl.components[`hand-pose__${this.id}`].store = this;
}
});
......
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