Skip to content
Snippets Groups Projects
Commit a80ff965 authored by Greg Fodor's avatar Greg Fodor
Browse files

Feedback from PR

parent df0d12e9
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,6 @@ async function exitScene() {
}
function updatePlayerInfoFromStore() {
const qs = queryString.parse(location.search);
const playerRig = document.querySelector("#player-rig");
playerRig.setAttribute("player-info", {
displayName: store.state.profile.display_name,
......@@ -144,7 +143,6 @@ function updatePlayerInfoFromStore() {
async function enterScene(mediaStream, enterInVR, janusRoomId) {
const scene = document.querySelector("a-scene");
const playerRig = document.querySelector("#player-rig");
const qs = queryString.parse(location.search);
document.querySelector("a-scene canvas").classList.remove("blurred");
registerNetworkSchemas();
......@@ -155,9 +153,7 @@ async function enterScene(mediaStream, enterInVR, janusRoomId) {
AFRAME.registerInputActions(inGameActions, "default");
document.querySelector("#player-camera").setAttribute("look-controls", "pointerLockEnabled: true;");
const qs = queryString.parse(location.search);
document.querySelector("#player-camera").setAttribute("look-controls");
scene.setAttribute("networked-scene", {
adapter: "janus",
......@@ -228,7 +224,6 @@ async function enterScene(mediaStream, enterInVR, janusRoomId) {
function onConnect() {}
function mountUI(scene) {
const qs = queryString.parse(location.search);
const disableAutoExitOnConcurrentLoad = qs.allow_multi === "true";
let forcedVREntryType = null;
......@@ -285,11 +280,9 @@ const onReady = async () => {
const res = await fetch(`/api/v1/hubs/${hubId}`);
const data = await res.json();
const hub = data.hubs[0];
const defaultSpaceChannel = hub.channels.find(c =>
c.attributes.find(a => a.length === 1 && a[0] === "default-space")
);
const gltfBundleUrl = defaultSpaceChannel.assets.find(a => a.asset_type === "gltf_bundle").src;
uiRoot.setState({ janusRoomId: defaultSpaceChannel.janus_room_id });
const defaultSpaceTopic = hub.topics[0];
const gltfBundleUrl = defaultSpaceTopic.assets.find(a => a.asset_type === "gltf_bundle").src;
uiRoot.setState({ janusRoomId: defaultSpaceTopic.janus_room_id });
initialEnvironmentEl.setAttribute("gltf-bundle", `src: ${gltfBundleUrl}`);
};
......
......@@ -36,15 +36,13 @@ class HomeRoot extends Component {
loadEnvironments = () => {
const environments = [];
const environmentLoads = ENVIRONMENT_URLS.map(
src =>
new Promise(async resolve => {
const res = await fetch(src);
const data = await res.json();
data.bundle_url = src;
environments.push(data);
resolve();
})
const environmentLoads = ENVIRONMENT_URLS.map(src =>
(async () => {
const res = await fetch(src);
const data = await res.json();
data.bundle_url = src;
environments.push(data);
})()
);
Promise.all(environmentLoads).then(() => this.setState({ environments }));
......
import React, { Component } from "react";
import PropTypes from "prop-types";
import { injectIntl, FormattedMessage } from "react-intl";
import { SCHEMA } from "../storage/store";
import { generateHubName } from "../utils/name-generation";
class HubCreatePanel extends Component {
......@@ -15,7 +14,7 @@ class HubCreatePanel extends Component {
environmentBundleUrl: ""
};
componentDidMount() {
constructor() {
this.setState({ environmentBundleUrl: this.props.environments[0].bundle_url });
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment