|
707 | 707 | }; |
708 | 708 | rtcWs.pushAssets = () => { |
709 | 709 | const landXrIframe = root.childNodes[0]; |
710 | | - const extentXrIframes = _getExtentXrIframes(landXrIframe); |
711 | | - const assetXrIframes = extentXrIframes.map(extentXrIframe => _getChildXrIframes(extentXrIframe)).flat(); |
| 710 | + const extentXrIframes = _getUnownedXrIframes(landXrIframe); |
| 711 | + const assetXrIframes = extentXrIframes.map(extentXrIframe => _getUnownedXrIframes(extentXrIframe)).flat(); |
712 | 712 | const html = `<xr-site>\n${assetXrIframes.filter(xrIframe => !!xrIframe.id).map(xrIframe => ' ' + xrIframe.outerHTML).join('\n')}\n</xr-site>\n`; |
713 | 713 | rtcWs.send(JSON.stringify({ |
714 | 714 | method: 'setInitialHtml', |
|
3694 | 3694 | const rects = []; |
3695 | 3695 | const covers = []; |
3696 | 3696 | const _getChildXrIframes = xrIframe => Array.from(xrIframe.contentWindow.iframe.contentDocument.querySelectorAll('xr-iframe')); |
3697 | | -const _getExtentXrIframes = xrIframe => _getChildXrIframes(xrIframe).filter(xrIframe => !/^owned:/.test(xrIframe.id)); |
| 3697 | +const _getUnownedXrIframes = xrIframe => _getChildXrIframes(xrIframe).filter(xrIframe => !/^owned:/.test(xrIframe.id)); |
3698 | 3698 | const _getOwnedXrIframes = xrIframe => _getChildXrIframes(xrIframe).filter(xrIframe => /^owned:/.test(xrIframe.id)); |
3699 | 3699 | const _connectLand = async () => { |
3700 | 3700 | if (!landState) { |
|
3715 | 3715 | xrIframe.addEventListener('error', reject); |
3716 | 3716 | }); |
3717 | 3717 | if (!live) return; |
3718 | | - const xrIframes = _getExtentXrIframes(xrIframe); |
| 3718 | + const xrIframes = _getUnownedXrIframes(xrIframe); |
3719 | 3719 |
|
3720 | 3720 | const _loadInventory = () => { |
3721 | 3721 | fetch(`${LAMBDA_URLS.inventory}?email=${encodeURIComponent(loginToken.email)}&token=${encodeURIComponent(loginToken.token)}`) |
|
4359 | 4359 | // emit extent's id'd xr-iframes |
4360 | 4360 |
|
4361 | 4361 | const landXrIframe = root.childNodes[0]; |
4362 | | - const extentXrIframes = _getExtentXrIframes(landXrIframe); |
4363 | | - const assetXrIframes = extentXrIframes.map(extentXrIframe => _getChildXrIframes(extentXrIframe)).flat(); |
| 4362 | + const extentXrIframes = _getUnownedXrIframes(landXrIframe); |
| 4363 | + const assetXrIframes = extentXrIframes.map(extentXrIframe => _getUnownedXrIframes(extentXrIframe)).flat(); |
4364 | 4364 |
|
4365 | 4365 | const stateXrSite = state.childNodes.find(node => node.tagName === 'xr-site'); |
4366 | 4366 | const stateXrIframes = stateXrSite ? stateXrSite.childNodes.filter(node => node.tagName === 'xr-iframe') : []; |
|
0 commit comments