Fix: don't measure compass if alpha is null, fix #1787

This commit is contained in:
Pieter Vander Vennet 2024-02-15 16:02:22 +01:00
parent d4bfd3894a
commit 3461ed6099

View file

@ -77,6 +77,9 @@ export class Orientation {
}
private update(event: DeviceOrientationEvent) {
if(event.alpha === null || event.beta === null || event.gamma === null){
return
}
this.gotMeasurement.setData(true)
// IF the phone is lying flat, then:
// alpha is the compass direction (but not absolute)