Skip to content

Commit

Permalink
fix(VRButton): SSR compat (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Sep 24, 2023
1 parent ff8f2ff commit 55cabc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webxr/VRButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class VRButton {
static xrSessionIsGranted = false

static registerSessionGrantedListener(): void {
if ('xr' in navigator) {
if (typeof navigator !== 'undefined' && 'xr' in navigator) {
;(navigator as Navigator).xr!.addEventListener('sessiongranted', () => {
VRButton.xrSessionIsGranted = true
})
Expand Down

0 comments on commit 55cabc8

Please sign in to comment.