From e0061ce2731895c0369a9595a65875832ce7230f Mon Sep 17 00:00:00 2001 From: Greg Fodor <gfodor@gmail.com> Date: Tue, 17 Apr 2018 08:55:21 -0700 Subject: [PATCH] Reorder definitions to fix build --- src/hub.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hub.js b/src/hub.js index 01f21706a..e9e837200 100644 --- a/src/hub.js +++ b/src/hub.js @@ -173,6 +173,13 @@ const onReady = async () => { document.querySelector("a-scene").emit("username-changed", { username: displayName }); }; + const exitScene = () => { + hubChannel.disconnect(); + const scene = document.querySelector("a-scene"); + scene.renderer.animate(null); // Stop animation loop, TODO A-Frame should do this + document.body.removeChild(scene); + }; + const enterScene = async (mediaStream, enterInVR, janusRoomId) => { const scene = document.querySelector("a-scene"); const playerRig = document.querySelector("#player-rig"); @@ -268,13 +275,6 @@ const onReady = async () => { } }; - const exitScene = () => { - hubChannel.disconnect(); - const scene = document.querySelector("a-scene"); - scene.renderer.animate(null); // Stop animation loop, TODO A-Frame should do this - document.body.removeChild(scene); - }; - remountUI({ enterScene, exitScene }); getAvailableVREntryTypes().then(availableVREntryTypes => { -- GitLab