From 9efaeab5b5919d8a1b7decf8111ae484884bbb77 Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Tue, 14 Jan 2025 14:58:29 +0100 Subject: [PATCH] attempt #2 to fix aframe upgrade data-issue --- src/3rd/js/aframe/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/3rd/js/aframe/index.js b/src/3rd/js/aframe/index.js index 9f60a6b..870efef 100644 --- a/src/3rd/js/aframe/index.js +++ b/src/3rd/js/aframe/index.js @@ -8,10 +8,14 @@ window.AFRAME.registerComponent('xrf', { init: async function () { // fix needed since aframe 1.7.0 (non-key/value string values no longer accepted) - for( var i in this.data ){ - if( !this.data[i] ) delete this.data[i] + urlArr = [] + for( var i in this.attrValue ){ + if( this.attrValue[i] ){ + if( i ) urlArr.push(i) + urlArr.push( this.attrValue[i] ) + } } - this.data = Object.keys(this.data)[0] + ":" + Object.values(this.data)[0] + this.data = urlArr.join(":") // override this.data when URL has passed (`://....com/?https://foo.com/index.glb` e.g.) if( typeof this.data == "string" ){