Skip to content

Commit 3c5763f

Browse files
fix(DeviceService): Fixed isPresentingHMD state thrashing
1 parent 20246f5 commit 3c5763f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/device.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ export class DeviceService {
668668
}
669669

670670
get isPresentingHMD() : boolean {
671-
return this.frameState.isPresentingHMD;
671+
return this.frameState.isPresentingHMD || !!this._vrDisplay && this._vrDisplay.isPresenting;
672672
}
673673

674674
requestPresentHMD() : Promise<void> {
@@ -942,6 +942,7 @@ export class DeviceServiceProvider {
942942
stableState.geolocationDesired = this.contextServiceProvider.geolocationDesired;
943943
stableState.geolocationOptions = this.contextServiceProvider.desiredGeolocationOptions;
944944
stableState.suggestedUserHeight = this.suggestedUserHeight;
945+
stableState.isPresentingHMD = this.deviceService.isPresentingHMD;
945946

946947
this.onUpdateStableState(this.deviceService._stableState);
947948

0 commit comments

Comments
 (0)