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

Room join error message #195

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"minijanus": "^0.5.0",
"mobile-detect": "^1.4.1",
"moving-average": "^1.0.0",
"naf-janus-adapter": "https://github.com/mozilla/naf-janus-adapter#feature/disconnect",
"naf-janus-adapter": "https://github.com/mozilla/naf-janus-adapter",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please publish to npm (use the release script) and point to a version

"networked-aframe": "https://github.com/mozillareality/networked-aframe#mr-social-client/master",
"nipplejs": "^0.6.7",
"query-string": "^5.0.1",
Expand Down
23 changes: 23 additions & 0 deletions src/assets/stylesheets/exited.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,26 @@
}
}

.fatal-error-panel {
display: flex;
flex-direction: column;
flex: 10 1 auto;
justify-content: flex-start;
align-items: center;
padding: 15px;

&__title {
@extend %top-title;
}

&__subtitle {
@extend %top-subtitle;
}

&__cancel-button {
@extend %bottom-button;
margin-top: 20px;
cursor: pointer;
}
}

15 changes: 15 additions & 0 deletions src/assets/stylesheets/ui-root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,18 @@
.ui-interactive {
pointer-events: auto;
}

.ui-alert-container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}

.ui-alert-box {
background-color: $darker-transparent;
border-radius: 8px;
min-width: 200px;
max-width: 400px;
}
1 change: 1 addition & 0 deletions src/assets/translations.data.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"entry.daydream-medium": "Daydream",
"entry.daydream-via-chrome": "Using Google Chrome",
"entry.enable-screen-sharing": "Share my desktop",
"entry.error-joining-room": "Error Joining Room",
"profile.save": "SAVE",
"profile.display_name.validation_warning": "Alphanumerics and hyphens. At least 3 characters, no more than 32",
"profile.header": "Your identity",
Expand Down
5 changes: 4 additions & 1 deletion src/hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async function enterScene(mediaStream, enterInVR, janusRoomId) {
});

if (!qsTruthy("offline")) {
scene.components["networked-scene"].connect();
const connectPromise = scene.components["networked-scene"].connect();

if (mediaStream) {
NAF.connection.adapter.setLocalMediaStream(mediaStream);
Expand All @@ -206,6 +206,9 @@ async function enterScene(mediaStream, enterInVR, janusRoomId) {
sceneEl.appendChild(screenEntity);
}
}
return connectPromise;
} else {
return Promise.resolve();
}
}

Expand Down
24 changes: 23 additions & 1 deletion src/react-components/ui-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,10 @@ class UIRoot extends Component {
};

onAudioReadyButton = () => {
this.props.enterScene(this.state.mediaStream, this.state.enterInVR, this.state.janusRoomId);
this.props.enterScene(this.state.mediaStream, this.state.enterInVR, this.state.janusRoomId).catch(e => {
this.setState({ fatalError: e });
this.exit();
});

const mediaStream = this.state.mediaStream;

Expand All @@ -489,6 +492,25 @@ class UIRoot extends Component {
};

render() {
if (this.state.fatalError) {
return (
<IntlProvider locale={lang} messages={messages}>
<div className="ui">
<div className="ui-alert-container">
<div className="ui-interactive ui-alert-box">
<div className="fatal-error-panel">
<div className="fatal-error__title">
<FormattedMessage id="entry.error-joining-room" />
</div>
<div className="fatal-error__subtitle">{this.state.fatalError}</div>
</div>
</div>
</div>
</div>
</IntlProvider>
);
}

if (!this.state.initialEnvironmentLoaded || !this.state.availableVREntryTypes || !this.state.janusRoomId) {
return (
<IntlProvider locale={lang} messages={messages}>
Expand Down