Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adapter and fileId errors #804

Merged
merged 8 commits into from
Dec 31, 2018
1 change: 1 addition & 0 deletions src/components/freeze-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ AFRAME.registerComponent("freeze-controller", {

onToggle: function() {
window.APP.store.update({ activity: { hasFoundFreeze: true } });
if (!NAF.connection.adapter) return;
NAF.connection.adapter.toggleFreeze();
if (NAF.connection.adapter.frozen) {
this.el.emit("play_freeze_sound");
Expand Down
2 changes: 2 additions & 0 deletions src/components/mute-mic.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ AFRAME.registerComponent("mute-mic", {
},

onToggle: function() {
if (!NAF.connection.adapter) return;
if (this.el.is("muted")) {
NAF.connection.adapter.enableMicrophone(true);
this.el.removeState("muted");
Expand All @@ -60,6 +61,7 @@ AFRAME.registerComponent("mute-mic", {
},

onMute: function() {
if (!NAF.connection.adapter) return;
if (!this.el.is("muted")) {
NAF.connection.adapter.enableMicrophone(false);
this.el.addState("muted");
Expand Down
3 changes: 2 additions & 1 deletion src/scene-entry-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ export default class SceneEntryManager {
const networkId = components.networked.data.networkId;
el.setAttribute("networked", { persistent: false });

const { fileId } = el.components["media-loader"].data;
const mediaLoader = components["media-loader"];
const fileId = mediaLoader.data && mediaLoader.data.fileId;

this.hubChannel.unpin(networkId, fileId);
});
Expand Down