Skip to content

Commit

Permalink
fix: vr button is shown for non vr content (#313)
Browse files Browse the repository at this point in the history
add `props.state.engine.isVr` condition
  • Loading branch information
yairans authored Dec 9, 2018
1 parent 093b867 commit 48a4132
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/vr-stereo-toggle/vr-stereo-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class VrStereoToggleControl extends BaseComponent {
*/
static shouldRender(props: any): boolean {
const componentConfig = props.config.components[this.displayName];
return !(Object.keys(componentConfig).length === 0 && componentConfig.constructor === Object);
return props.state.engine.isVr && !(Object.keys(componentConfig).length === 0 && componentConfig.constructor === Object);
}
/**
* Creates an instance of VrStereoToggleControl.
Expand Down

0 comments on commit 48a4132

Please sign in to comment.