Skip to content

Commit

Permalink
Listen to DOMContentLoaded if scene is not defined before updating en…
Browse files Browse the repository at this point in the history
…ter VR interfaces (fix #4373)
  • Loading branch information
dmarcos committed Dec 25, 2019
1 parent b9b6813 commit 7f017a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ window.addEventListener('vrdisplayactivate', function (evt) {
if (isWebXRAvailable) {
var updateEnterInterfaces = function () {
var sceneEl = document.querySelector('a-scene');
if (!sceneEl) {
window.addEventListener('DOMContentLoaded', updateEnterInterfaces);
return;
}
if (sceneEl.hasLoaded) {
sceneEl.components['vr-mode-ui'].updateEnterInterfaces();
} else {
Expand Down

0 comments on commit 7f017a3

Please sign in to comment.