Skip to content

Commit 7983223

Browse files
committed
inject emulator even if isSessionSupported throws an error
1 parent 72d7caa commit 7983223

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/xr/src/store.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,16 @@ function injectEmulator(store: StoreApi<XRState<any>>, emulate: EmulatorOptions
292292
if (typeof navigator === 'undefined') {
293293
return
294294
}
295-
Promise.all([navigator.xr?.isSessionSupported('immersive-vr'), navigator.xr?.isSessionSupported('immersive-ar')])
295+
Promise.all([
296+
navigator.xr?.isSessionSupported('immersive-vr').catch((e) => {
297+
console.error(e)
298+
return false
299+
}),
300+
navigator.xr?.isSessionSupported('immersive-ar').catch((e) => {
301+
console.error(e)
302+
return false
303+
}),
304+
])
296305
.then(([vr, ar]) => (!ar && !vr ? import('./emulate.js') : undefined))
297306
.then((pkg) => {
298307
if (pkg == null) {

0 commit comments

Comments
 (0)