about summary refs log tree commit diff
path: root/app/javascript/mastodon/is_mobile.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/is_mobile.js')
-rw-r--r--app/javascript/mastodon/is_mobile.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/javascript/mastodon/is_mobile.js b/app/javascript/mastodon/is_mobile.js
index 014a9a8d5..129d66682 100644
--- a/app/javascript/mastodon/is_mobile.js
+++ b/app/javascript/mastodon/is_mobile.js
@@ -12,6 +12,15 @@ export function isMobile(width, columns) {
 };
 
 const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
+let userTouching = false;
+
+window.addEventListener('touchstart', () => {
+  userTouching = true;
+}, { once: true });
+
+export function isUserTouching() {
+  return userTouching;
+}
 
 export function isIOS() {
   return iOS;