diff options
Diffstat (limited to 'webapp/utils')
-rw-r--r-- | webapp/utils/async_client.jsx | 23 | ||||
-rw-r--r-- | webapp/utils/constants.jsx | 5 | ||||
-rw-r--r-- | webapp/utils/user_agent.jsx | 10 |
3 files changed, 26 insertions, 12 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index babfefb6d..185fa5b4e 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -10,6 +10,7 @@ import ChannelStore from 'stores/channel_store.jsx'; import PostStore from 'stores/post_store.jsx'; import UserStore from 'stores/user_store.jsx'; import * as utils from './utils.jsx'; +import * as UserAgent from './user_agent.jsx'; import ErrorStore from 'stores/error_store.jsx'; import Constants from './constants.jsx'; @@ -871,17 +872,19 @@ export function getSuggestedCommands(command, suggestionId, component) { (data) => { var matches = []; data.forEach((cmd) => { - if (('/' + cmd.trigger).indexOf(command) === 0) { - const s = '/' + cmd.trigger; - let hint = ''; - if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) { - hint = cmd.auto_complete_hint; + if (cmd.trigger !== 'shortcuts' || !UserAgent.isMobileApp()) { + if (('/' + cmd.trigger).indexOf(command) === 0) { + const s = '/' + cmd.trigger; + let hint = ''; + if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) { + hint = cmd.auto_complete_hint; + } + matches.push({ + suggestion: s, + hint, + description: cmd.auto_complete_desc + }); } - matches.push({ - suggestion: s, - hint, - description: cmd.auto_complete_desc - }); } }); diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx index dbdc3e9f1..24d1d6b19 100644 --- a/webapp/utils/constants.jsx +++ b/webapp/utils/constants.jsx @@ -797,7 +797,10 @@ export const Constants = { LICENSE_GRACE_PERIOD: 1000 * 60 * 60 * 24 * 15, // 15 days PERMISSIONS_ALL: 'all', PERMISSIONS_TEAM_ADMIN: 'team_admin', - PERMISSIONS_SYSTEM_ADMIN: 'system_admin' + PERMISSIONS_SYSTEM_ADMIN: 'system_admin', + MENTION_MEMBERS: 'mention.members', + MENTION_NONMEMBERS: 'mention.nonmembers', + MENTION_SPECIAL: 'mention.special' }; export default Constants; diff --git a/webapp/utils/user_agent.jsx b/webapp/utils/user_agent.jsx index 657718627..dbabd594b 100644 --- a/webapp/utils/user_agent.jsx +++ b/webapp/utils/user_agent.jsx @@ -61,6 +61,14 @@ export function isIosWeb() { return isIosSafari() || isIosChrome(); } +export function isIos() { + return userAgent.indexOf('iPhone') !== -1; +} + +export function isAndroid() { + return userAgent.indexOf('Android') !== -1; +} + export function isAndroidChrome() { return userAgent.indexOf('Android') !== -1 && userAgent.indexOf('Chrome') !== -1 && userAgent.indexOf('Version') === -1; } @@ -70,7 +78,7 @@ export function isAndroidWeb() { } export function isMobileApp() { - return userAgent.indexOf('iPhone') !== -1 && userAgent.indexOf('Safari') === -1 && userAgent.indexOf('CriOS') === -1; + return isAndroid() || isIos(); } export function isFirefox() { |