Skip to content

Commit

Permalink
fix: spread copy gltf-model attrs to restore later
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-liang committed Jun 22, 2023
1 parent 51ba95a commit 15ac173
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aframe-mods/show-hide-on-enter-ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AFRAME.components['hide-on-enter-ar'].Component.prototype.init = function init()
this.el.sceneEl.addEventListener('enter-vr', () => {
if (self.el.sceneEl.is('ar-mode')) {
self.el.object3D.visible = false;
self.gltfAttributes = self.el.getAttribute('gltf-model');
self.gltfAttributes = { ...self.el.getAttribute('gltf-model') };
if (self.gltfAttributes) {
self.el.removeAttribute('gtf-model');
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/show-hide-on-enter-vr.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AFRAME.registerComponent('hide-on-enter-vr', {
this.el.sceneEl.addEventListener('enter-vr', () => {
if (self.el.sceneEl.is('vr-mode')) {
self.el.object3D.visible = false;
self.gltfAttributes = self.el.getAttribute('gltf-model');
self.gltfAttributes = { ...self.el.getAttribute('gltf-model') };
if (self.gltfAttributes) {
self.el.removeAttribute('gtf-model');
}
Expand Down

0 comments on commit 15ac173

Please sign in to comment.