diff --git a/packages/frontend/src/pages/qr.show.vue b/packages/frontend/src/pages/qr.show.vue
index 5b89b1841c..f6f014df28 100644
--- a/packages/frontend/src/pages/qr.show.vue
+++ b/packages/frontend/src/pages/qr.show.vue
@@ -17,10 +17,10 @@ SPDX-License-Identifier: AGPL-3.0-only
'--MI_SPACER-max': '14px',
'cursor': canShare ? 'pointer' : 'default',
}"
- @click="share"
>
@@ -31,7 +31,8 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ userName($i) }}
-
+
+
@@ -150,6 +151,8 @@ onUnmounted(() => {
//#region flip
const THRESHOLD = -3;
+// @ts-ignore
+const deviceMotionPermissionNeeded = window.DeviceMotionEvent && typeof window.DeviceMotionEvent.requestPermission === 'function';
const flipEls: Set = new Set();
const flip = ref(false);
@@ -164,6 +167,18 @@ watch(flip, (newState) => {
});
});
+function requestDeviceMotion() {
+ if (!deviceMotionPermissionNeeded) return;
+ // @ts-ignore
+ window.DeviceMotionEvent.requestPermission()
+ .then((response: string) => {
+ if (response === 'granted') {
+ window.addEventListener('deviceorientation', handleOrientationChange);
+ }
+ })
+ .catch(console.error);
+}
+
onMounted(() => {
window.addEventListener('deviceorientation', handleOrientationChange);
});