From 15ac1734fdab379f66312eb277ca18d30e13108d Mon Sep 17 00:00:00 2001 From: Ivan Liang Date: Wed, 21 Jun 2023 23:54:20 -0400 Subject: [PATCH] fix: spread copy gltf-model attrs to restore later --- src/aframe-mods/show-hide-on-enter-ar.js | 2 +- src/components/show-hide-on-enter-vr.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aframe-mods/show-hide-on-enter-ar.js b/src/aframe-mods/show-hide-on-enter-ar.js index 249bbffe4..ce5a70e6e 100644 --- a/src/aframe-mods/show-hide-on-enter-ar.js +++ b/src/aframe-mods/show-hide-on-enter-ar.js @@ -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'); } diff --git a/src/components/show-hide-on-enter-vr.js b/src/components/show-hide-on-enter-vr.js index 45d0d04cb..7b7f460ee 100644 --- a/src/components/show-hide-on-enter-vr.js +++ b/src/components/show-hide-on-enter-vr.js @@ -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'); }