Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toggleVRPresentation() {
try {
if (this.isVRPresentationActive) {
XR.exitVR(this.sceneName);
} else {
XR.enterVR(this.sceneName);
}
} catch (e) {
// logger.error('Unable to start/stop WebVR System: ' + e.message);
return;
}
this.isVRPresentationActive = !this.isVRPresentationActive;
}
toggleVRPresentation() {
try {
if (this.state.isVRPresentationActive) {
XR.exitVR(this.props.sceneName);
} else {
XR.enterVR(this.props.sceneName);
}
} catch(e) {
logger.error('Unable to start/stop WebVR System: ' + e.message);
return;
}
this.setState({isVRPresentationActive: !this.state.isVRPresentationActive});
}
toggleVRPresentation() {
try {
if (this.state.isVRPresentationActive) {
XR.exitVR(this.props.sceneName);
} else {
XR.enterVR(this.props.sceneName);
}
} catch(e) {
logger.error('Unable to start/stop WebVR System: ' + e.message);
return;
}
this.setState({isVRPresentationActive: !this.state.isVRPresentationActive});
}