diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-10-04 14:38:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-04 14:38:19 -0400 |
commit | 816a738d28bd475a445963b95eb854614a12a032 (patch) | |
tree | 7ac4072699692ada4807f45c760d8089c252c0a6 /webapp/utils/user_agent.jsx | |
parent | b9dc759449f11e0352f97164360cc400fbc112d8 (diff) | |
download | chat-816a738d28bd475a445963b95eb854614a12a032.tar.gz chat-816a738d28bd475a445963b95eb854614a12a032.tar.bz2 chat-816a738d28bd475a445963b95eb854614a12a032.zip |
PLT-4343 Fixes for mobile main menu (#4148)
* Fixed mobile app link in the main menu to be displayed on mobile browsers
* Fixed doubled up dividers in mobile menu
* Added scrolling to mobile main menu
Diffstat (limited to 'webapp/utils/user_agent.jsx')
-rw-r--r-- | webapp/utils/user_agent.jsx | 9 |
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() { |