summaryrefslogtreecommitdiffstats
path: root/webapp/utils/user_agent.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils/user_agent.jsx')
-rw-r--r--webapp/utils/user_agent.jsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/webapp/utils/user_agent.jsx b/webapp/utils/user_agent.jsx
index dbabd594b..cece453ce 100644
--- a/webapp/utils/user_agent.jsx
+++ b/webapp/utils/user_agent.jsx
@@ -77,8 +77,15 @@ export function isAndroidWeb() {
return isAndroidChrome();
}
+// Returns true if and only if the user is using a Mattermost mobile app. This will return false if the user is using the
+// web browser on a mobile device.
export function isMobileApp() {
- return isAndroid() || isIos();
+ return userAgent.indexOf('iPhone') !== -1 && userAgent.indexOf('Safari') === -1 && userAgent.indexOf('CriOS') === -1;
+}
+
+// Returns true if and only if the user is using Mattermost from either the mobile app or the web browser on a mobile device.
+export function isMobile() {
+ return isIos() || isAndroid();
}
export function isFirefox() {